Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get the value from a div tag

Status
Not open for further replies.

onressy

Programmer
Joined
Mar 7, 2006
Messages
421
Location
CA
Hi i have a div that has a 0 value by default, all values it will contain are numeric.

<div id="v5">0</div>

I trying to read the value of the innerHTML but am having no luck, is this possible? This is what i have so far:

if (document.getElementById("v5").innerHTML.value > 0) {


any suggestions?
 
>>document.getElementById("v5").innerHTML.value

there is no value method for innerHTML

try this:
TheStr=document.getElementById("v5").innerHTML
if(TheStr.length>0)
{
alert("Something is there!")
}


Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top