i have two spans on my page with class=’hidden’ and then some javascript to remove the class when a condition is met, its working fine in ie 9/10 and firefox but its not working in chrome when I run the function in the chrome JS console I get the message TypeError: Cannot read property ‘attributes’ of null
Anybody know whats going on?
<script type='text/javascript' >
function showhidden() {
var att =document.getElementById('hiddentextbox');
att.attributes[0].value='';
att =document.getElementById('hiddentextbox1');
att.attributes[0].value='';
}</script>
Thanks
Try changing the class by using
att.className = ''instead of what you’re doing, which I have never seen before.You might also want to check out jQuery, which has good built-in
.show()and.hide()functions.