How do you alter the content of a <div>
using javascript when the <div>
has no id
or class
.
I know that using something like document.getElementById('foo').innerHTML = 'Your content';
Could have been used if the <div>
had an id. But in my case the content I want to alter is like this
<div unselectable="on" style="position: absolute; padding: 2px; top: 0px; left: 1px; background-color: rgb(255, 102, 0); color: white;">BOO</div>
I am partial to using document.getElementsByTagName("div")[0].innerHTML = "BOO";
to find it but how do I then proceed to modify its content? Also is this a good way to doing things?
Boo
<div unselectable="on" class="calendar_white_corner_inner"></div>