By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,780 Members | 1,126 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,780 IT Pros & Developers. It's quick & easy.

getElementById()

P: 1
Hi,

I m trying to accesss the form elements value by getElementById() method of document object.It working fine in Internet Explorer, but in Mozilla firefox its not working.

I write the function in javascript like this.

var pval=document.getElementById(pname).value;

pname is the id of the drop-down list.

Can anybody tell me the correct syntax to write this function for Mozilla Firefox?
Jan 17 '08 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
Welcome to TSDN!

This should work unless it should be a string "pname". Show the HTML code.
Jan 17 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.