How can I access different page controls using JavaScript
?
For example, I have two pages: Page1.htm
and Page2.htm
.
I write my JavaScript code in Page1.htm
and I need to access a textbox or any other control which is placed in Page2.htm
.
How can I access different page controls using JavaScript
?
For example, I have two pages: Page1.htm
and Page2.htm
.
I write my JavaScript code in Page1.htm
and I need to access a textbox or any other control which is placed in Page2.htm
.
Try it like,
$(function(){
$.get('page2.html',function(html){
console.log($(html).find('textarea'));
});
});