<html> <head> <title>ThaiCreate.Com Tutorial</title> <style type="text/css"> .css1 { font-size: 11px; font-weight: bold; color: #000000; } .css2 { font-size: 20; font-weight: bold; color: #FF0000; } </style> </head> <body> <form name="frmMain" action="" method="post"> <input type="text" name="txtText" value="ThaiCreate.Com" class="css1" OnFocus="document.frmMain.txtText.className='css2';" OnBlur="document.frmMain.txtText.className='css1';"> <br> <input type="button" name="btn1" value="Stylesheet 1" onClick="document.frmMain.txtText.className='css1';"> <input type="button" name="btn2" value="Stylesheet 2" onClick="document.frmMain.txtText.className='css2';"> </form> </body> </html>
.css { font-size: 11px; font-weight: bold; color: #000000; }
.css { font-size: 20; font-weight: bold; color: #FF0000; }
<html> <head> <title>ThaiCreate.Com Tutorial</title> <link rel="stylesheet" href="style1.css" id="stylesheet"> <script type="text/javascript"> function changeStyle(url) { document.getElementById('stylesheet').href = url; } </script> </head> <body> <form name="frmMain" action="" method="post"> <input type="text" name="txtText" value="ThaiCreate.Com"class="css"> <br> <input type="button" name="btn1" value="Stylesheet 1" onClick="changeStyle('style1.css');"> <input type="button" name="btn2" value="Stylesheet 2" onClick="changeStyle('style2.css');"> </form> </body> </html>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท