I have the following code
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<div class="full-details-box" name="full_details_box" id="full-details-box"></div>
<hr />
<script type='text/javascript'>
function show_3136(){
document.full_details_box.style.display='block';
}
show_3136();
</script>
</body>
</html>
I get the error: window.document.full_details_box is undefined
I get the error for the line:
document.full_details_box.style.display='block';
But I do have a <div> element with the name full_details_box, so why the error?
Don’t use the
nameattribute for divs. It doesn’t even exist. Use the id, and: