View Full Version : getElementById undefined

09-30-2011, 07:53 AM
I am using this code to generate hidden HTML code in Facebook :

echo "<div id=\"y257y\" style=\"display:none;\">".$fdesc."</div>";

And, I am trying to get this element back in JS using the following code


But, I am getting an error: Undefined

Can anyone kindly help me out ?


Old Pedant
09-30-2011, 08:38 AM
Probably, it is getValue() that is undefined.

Probably you need to use document.getElementById("y257y").innerHTML

A <div> doesn't have a value. And even for elements that do have values, you would use .value and not .getValue()

09-30-2011, 09:29 AM
Hi, You can use getElement by id as show below


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum