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
}
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
}