PDA

View Full Version : how to center a javascript thingie


daisy
09-30-2002, 11:04 AM
i want to center this sort of counter

<script LANGUAGE="JavaScript">


var total = 0



function display(element) {


if (element.checked)

total++
else

total--

element.form.num.value = total
}


// -->
</SCRIPT></center></head>
<FORM>
<INPUT TYPE="text" VALUE="0" NAME="num" SIZE=10 onFocus="this.blur()"><BR>

<INPUT TYPE="checkbox" onClick="display(this)">
a question <br>

Garadon
09-30-2002, 11:20 AM
like this?
<script LANGUAGE="JavaScript">


var total = 0



function display(element) {


if (element.checked)

total++
else

total--

element.form.num.value = total
}


// -->
</SCRIPT></head><body>
<center><FORM>
<INPUT TYPE="text" VALUE="0" NAME="num" SIZE=10 onFocus="this.blur()"><BR>

<INPUT TYPE="checkbox" onClick="display(this)">
a question <br>
</center></body