kfir91 Posted June 18, 2009 Share Posted June 18, 2009 ok i have js code .. in explorer its ok the js is : var year = document.getElementById('year').value; in explorer year return "2009" and in firefox return "undefined" the div is : <td class="month"><span id="year" value="2009">2009</span></td> what the problem ? Link to comment https://forums.phpfreaks.com/topic/162781-documentgetelementbyidvalue-return-undefined-in-firefox/ Share on other sites More sharing options...
ted_chou12 Posted June 18, 2009 Share Posted June 18, 2009 I dont know if value attributes work with span, but u can try: year = document.getElementById('year').innerHTML; Also try removing the var. see if this works, good luck Ted Link to comment https://forums.phpfreaks.com/topic/162781-documentgetelementbyidvalue-return-undefined-in-firefox/#findComment-859010 Share on other sites More sharing options...
kfir91 Posted June 18, 2009 Author Share Posted June 18, 2009 ok tnx inner work solve Link to comment https://forums.phpfreaks.com/topic/162781-documentgetelementbyidvalue-return-undefined-in-firefox/#findComment-859013 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.