13
rated 0 times
[
14]
[
1]
/ answers: 1 / hits: 87305
/ 8 Years ago, thu, february 25, 2016, 12:00:00
So, i know that this has already been answered, but none of the previous answers managed to make my code work. I have a html structure as the following:
<div class=form>
<div class=formrow>
<div class=previewcontainer>
<object id=preview>
<object>
</div>
</div>
</div>
I am trying to set the data attribute to the object like this:
var link = http://www.someurl.com;
var preview = document.querySelectorAll (#preview);
preview.setAttribute(data, link);
However, I get an error preview.setAttribute is not a function
More From » object