0

I am using asp.net 4.5.1 webform. I have a asp.net page "Default.aspx".I have a IFrame in this page :

<iframe id="myFrame" name="myFrame" src="" runat="server"></iframe>

also I have a button on this page. On the click event of the button I set src of Iframe which is not in my domain. forexample : src="www.google.com". when Iframe become loaded inside of that is a textarea.

<textarea class="textarea" name="msg" id="msg" ></textarea>

I want after each time that my Iframe loaded (all the time that I click on my button in default.aspx which force the Iframe load), change the text of msg textarea. I used jquery but I wasnt successful. is there any way to do?

2
  • What msg you want to give in textarea? Commented Jan 13, 2014 at 7:11
  • I wanna set "Hello" or any other text as Value of textarea Commented Jan 13, 2014 at 7:13

1 Answer 1

1

DEMO

$("#btn1").on("click", function () {
    $("#msg").text("Hello");
});
Sign up to request clarification or add additional context in comments.

2 Comments

This code work correct but not in my case, which the textarea is inside of Iframe and also Iframe's src is external link
Is Your textarea from external site?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.