• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Javascript Problem

jongyoo

Member
Hey guys, this is a simple Javascript problem which I've searched but haven't gotten any good results. I was wondering how I could increment the number in the text box up one when I click that button. So far, I've got this. Thanks

<html>
<body>

<form>
Enter random text
<br>
<input type="text" name="test" value="1">
<br>
<input type="submit" value="Submit">
</form>

</body>
</html>
 
Try this:

<html>
<body>

<form>
Enter random text
<br>
<input type="text" name="test" value="1" id="num">
<br>
<input type="button" value="Submit" onclick="javascript:num.value++;">
</form>

</body>
</html>
 
Back
Top