I have set of frames and html pages . I have selected one of the frames html element from another html page and I want to change the content using jquery.
Here , I want to change "test.com" to "something.com" . Please let me know , how to achieve this.
HTML element in frame 0 :
<span class="topmid-left">Connected to <b>My Site 'test.com' </b> </span>
The same element can be selectable by jquery by setting context :
**query -** $("b",window.frames[0].document)
**result -** <b>My Site 'test.com' </b>
How to change the content of tag here.
Thanks.
Here is the fiddle: https://jsfiddle.net/swaprks/L1rq4o7a/
Use jquery and add the following to your javascript:
$(".topmid-left b").html("My Site 'something.com'");
try this:
<script>
var str = 'your text';
$( "b" ).html( str );
or
$("b").text(YOUR_TEXT)
</script>
Learn More
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With