Skip to content

Instantly share code, notes, and snippets.

@lydonchandra
Created November 13, 2012 01:55
Show Gist options
  • Save lydonchandra/4063438 to your computer and use it in GitHub Desktop.
Save lydonchandra/4063438 to your computer and use it in GitHub Desktop.
Iframe jquery access
// Find myForm in myIframe
var $myForm = $('#myIframe').contents().find('#myForm');
// set inputField value in $myForm
$('input[name="inputField"]', $myForm).val(JSON.stringify(inputField));
// check checkbox value in $printForm
$('input[name="myCheckbox"]', $myForm).val() === 'on'
// without jQuery
document.myForm.myCheckbox.checked
"myValue": document.myForm.mySelectBox.value,
"myValue": $('select[name=mySelectBox]', $myForm).val(),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment