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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help!! Change Element Value

Status
Not open for further replies.

NJLDoc

Programmer
Jan 25, 2002
93
Is there a way to increment the value of a textbox using javascript function(s)?

function whichElement(e)
{
var targ;
if (!e)
{
var e=window.event;
}
if (e.target)
{
targ=e.target;
}
else if (e.srcElement)
{
targ=e.srcElement;
}
if (targ.nodeType==3)
{
targ = targ.parentNode;
}
var tname;
tname=targ.value;

alert("You selected " + tname + ".");
//Instead of alert, I want to change the value
targ.value = targ.value +1

}
 
you should be asking here:



--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top