Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ʹÓÃjavascript¶¯Ì¬Ìí¼ÓºÍɾ³ýtableµÄÐкÍÁÐ

µÚÒ»ÖÖ·½·¨£ºÊ¹ÓÃinsertRowÌí¼ÓÐУ¬Ê¹ÓÃinsertCellÌí¼Óµ¥Ôª¸ñ£¬ÔÙÓÃinnerHTMLÌî³äµ¥Ôª¸ñ¡£Ê¹ÓÃdeleteRowɾ³ýÐУ¬´úÂëÈçÏ£º
Javascript´úÂ룺
function addRow()
  {
     var root = document.getElementById("tbody")
     var allRows = root.getElementsByTagName('tr');
     var allCells = allRows[0].getElementsByTagName('td');
     var newRow = root.insertRow();
     var newCell0 = newRow.insertCell();
     var newCell1 = newRow.insertCell();
     var newCell2 = newRow.insertCell();
     var newCell3 = newRow.insertCell();
     newCell0.innerHTML = allCells[0].innerHTML;
     newCell1.innerHTML = allCells[1].innerHTML;
     newCell2.innerHTML = allCells[2].innerHTML;
     newCell3.innerHTML = allCells[3].innerHTML;
  }
  function removeRow(r)
  {
    var root = r.parentNode;
    root.deleteRow(r);
  }
HTML´úÂ룺
<table>
  <tbody id="tbody">
    <tr>
        <td><select><option>hello</option><option>hi</option></select></td>
        <td><input type="text" value="enter you name here" /></td>
        <td><input type="text" value="text2"/></td>
        <td&g


Ïà¹ØÎĵµ£º

³£ÓõÄjavascriptÓï¾ä¼¯


×î¶ÌµÄÍ϶¯´úÂë
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<script l ......

javascript»ù´¡ÖªÊ¶¡¾×îÏ꾡¡¿

1 ´´½¨½Å±¾¿é
1: <script language=”JavaScript”>
2: JavaScript code goes here
3: </script> 
2 Òþ²Ø½Å±¾´úÂë
1: <script language=”JavaScript”>
2: <!--
3: document.write(&ldquo ......

IEºÍFirefoxÔÚcss,JavaScript·½ÃæµÄ¼æÈÝÐÔ

1.document.formName.item("itemName") ÎÊÌâ
˵Ã÷:IEÏÂ,¿ÉÒÔʹÓÃdocument.formName.item("itemName")»òdocument.formName.elements["elementName"];FirefoxÏÂ,Ö»ÄÜʹÓÃdocument.formName.elements["elementName"].
½â¾ö·½·¨:ͳһʹÓÃdocument.formName.elements["elementName"].
2.¼¯ºÏÀà¶ÔÏóÎÊÌâ
˵Ã÷:IEÏÂ,¿ÉÒÔʹÓÃ() ......

Javascript²Ù×÷select¿Ø¼þ´óÈ«

1ÅжÏselectÑ¡ÏîÖРÊÇ·ñ´æÔÚValue="paraValue"µÄItem 
 2ÏòselectÑ¡ÏîÖР¼ÓÈëÒ»¸öItem 
 3´ÓselectÑ¡ÏîÖРɾ³ýÒ»¸öItem 
 4ɾ³ýselectÖÐÑ¡ÖеÄÏî 
 5ÐÞ¸ÄselectÑ¡ÏîÖРvalue="paraValue"µÄtextΪ"paraText" 
 6ÉèÖÃselectÖÐtext="paraText"µÄµ ......

ActiveX×é¼þÓëJavaScript½»»¥

2007-10-24 23:55
1£®ÔÚCOM×é¼þÖе÷ÓÃJavaScriptº¯Êý
// Á¬½Óµã·½Ê½Ò³Ãæjavascript½Å±¾
<object classid="CLSID:B568F111-DFE4-4944-B67F-0728AB2AB30F" id="testCom" VIEWASTEXT></object>
<script language="JavaScript" for="testCom" event="staTe(s)">
      &n ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ