PlumInternet
asked on
Update HTML within a Div using document.getElementsByClassName
Hello,
We are attempting to update HTML within a div tag using .getElementsByClassName on pageload.
For example:
<div class="description ng-scope">
<p>Don't ask me.</p>
<p>I have no idea what it does.....</p>
</div>
Updated to:
<div class="description ng-scope">
<p>updated</p>
</div.
We have attempted to use:
<script>
document.getElementsByClas sName("ng- scope").in nerHTML = "<p>updated</p>";
</script>
But it doesnt seem to work just wondering whats wrong with my syntax. Note we cant use jQuery.
Thanks
We are attempting to update HTML within a div tag using .getElementsByClassName on pageload.
For example:
<div class="description ng-scope">
<p>Don't ask me.</p>
<p>I have no idea what it does.....</p>
</div>
Updated to:
<div class="description ng-scope">
<p>updated</p>
</div.
We have attempted to use:
<script>
document.getElementsByClas
</script>
But it doesnt seem to work just wondering whats wrong with my syntax. Note we cant use jQuery.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi PlumInternet,
If my answer helped you in resolving your problem, please mark it as an accepted answer ! :)
Regards,
Ronak
If my answer helped you in resolving your problem, please mark it as an accepted answer ! :)
Regards,
Ronak
ASKER
Doh, I thought I did. Sorry.
Its okay, no worries :)
ASKER