Così dovrebbe funzionare:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>test</title>
<script type="text/javascript">
function miaFunz(){
var attribute_value = document.getElementById('mioDiv').getAttribute('na me');
alert(attribute_value);
}
</script>
</head>
<body>
<div id="mioDiv" name="pippo"></div>
Prova
</body>
</html>
![]()