Thanks chen but how to define myTD? cause td is not an object as the error occurs during run time please try the code here text box with ril shoud move on click of button should move one column right and left on click of > and < button respectivly. please try and help
<HTML> <HEAD> <TITLE> Dynamic colspan</TITLE> <META NAME="Author" CONTENT="Vaishali Pandya"> </HEAD> <BODY> <script> function right(){ } function left(){ } </script> <form name=frm1 method=post> <table name=mytable width="100%" border=1> <tr> <td name="td1" colspan=1>   </td> <td name=td2 colspan=8> <input style="width=100%" type=text name=t1 value="ril"> </input> </td> <td> <input style="width=45%" type=button name=Left value="<" onclick="left()"> <input style="width=45%" type=button name=Right value=">" onclick="right()"> </td> <tr> <tr> <td width="10%"> </td><td width="10%"> </td> <td width="10%"> </td><td width="10%"> </td> <td width="10%"> </td><td width="10%"> </td> <td width="10%"> </td><td width="10%"> </td> <td width="10%"> </td><td width="10%"> </td> </tr> </table> </form> </BODY> </HTML> Thanks Vaishali RIL Ahm'd in a javascript function function changeColspan( amt ) { myTD.colspan = amt; } from button: <BUTTON onclick="changeColspan( 2 )">Change to 2</BUTTON> Of course you dont have to hardcode the 2 and you dont need a parameter amount. You can use a dynamic value or read it from a text box. -Tim -----Original Message----- From: [Vaishali S. Pandya] To: [EMAIL PROTECTED] Sent: 5/17/2002 6:29 AM Subject: how to use javascript variable in html? hi friends i want to write an html code were in table the colspan = <here i want to use variable> on button click i want to increase or decrease the colspan value how to make this value vari? well i am sorry but i don't want to use JSP here cause i want this thing on client side only. can i do it with javascript or html itself? Answer will be appriciated ThankX in advance Vaishali RIL Ahm'd ======================================================================== === To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com