user587159 user587159 - 6 months ago 19
HTML Question

How to change HTML Object element data attribute value in javascript

How do you change HTML Object element data attribute value in JavaScript?

Here is what i am trying

<object type="text/html" id="htmlFrame" style="border: none;" standby="loading" width="100%"></object>

var element = document.getElementById("htmlFrame");
element.setAttribute("data", "http://www.google.com");

Answer

and in jquery:

$('element').attr('some attribute','some attributes value')

i.e

$('a').attr('href','http://www.stackoverflow.com/')
Comments