Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
182 views
in Technique[技术] by (71.8m points)

javascript - document.getElementById('grand_total_display').innerHTML = "Total is : $"+variable; is displaying error in IE6 and IE7

document.getElementById('grand_total_display).innerHTML = "Total is : $"+variable; is displaying error in IE6 and IE7

I have an <li>with id as grand_total_display with some text displayed in it.

<li class="bannerprice" id="grand_total_display">TOTAL PRICE : $0</li>

I am executing a jjavascript function to insert some other value into it.. but I am displayed with the error as given below: alt text

Please help me to rectify the issue

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Apparently there's no element in the DOM with 'totaldisplay' as its id, or, as galambalazs suggests, you might have multiple elements with the same id.

With IE7 you can use "Internet Explorer Developer Toolbar" and "Web Development Helper" plugin, to find the problem.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...