Is it possible to insert an id into a div using prototype/javascript? Basically:
<div> Hello </div>
should become:
<div id="myId"> Hello </div>
Thanks!
Yes, but without more code it's going to be tough to do because you have no way of identifying that <div>
as it currently is coded. If it followed a <div>
with and ID of somediv
then you could do:
$$('#somediv > div')[0].setAttribute('id', 'myId');