javascript - Get textarea value inside iframe -
I can get text from textarea
with my current code but I want to receive it When an iframe has textarea
, is it possible?
My current code
& lt; Script & gt; Function get_text () {var value = $ ('textarea'). Val (); . $ ('# Show_value') HTML (value); } & Lt; / Script & gt; & Lt; Text area & gt; & Lt; / Text field & gt; & Lt; Div id = "show_value" & gt; & Lt; / Div & gt; & Lt; A href = "#" onclick = "get_text ()" & gt; Click to show me text & lt; / A & gt; Trying to edit code like code below code but it did not work
= "Snippet" data-lang = "js" data-hide = "false"> & Lt; Script & gt; Function get_text () {var value = $ ('iframe textarea'). Val (); . $ ('# Show_value') HTML (value); } & Lt; / Script & gt; & Lt; Iframe src = 'http: //check0909.vv.si/s.html'> & Lt; / Iframe & gt; & Lt; Div id = "show_value" & gt; & Lt; / Div & gt; & Lt; A href = "#" onclick = "get_text ()" & gt; Click to show me text & lt; / A & gt;
You
Put a name and an id and you should be able to use something like this.
$ ('iframe [name = select_frame]'). material (). ('# Select_name'). Val ();
Comments
Post a Comment