<h1 class="MyClass">一</h1>
<script>
var hs =document.getElementsByTagName('h1');
alert(hs[0].className);
hs[0].className='XXXX';
</script>
This is this code. Why can't I set a new value for this tag? setAttribute() doesn't work either.
Is there any interference from other h1 tags? I can use your code to test it and it’s fine
Are these the only codes? It should be fine. . .
Can be set.