如上图,根据身高其一数据,算出另一数据,实现如下: 首先html代码部分: <table> <tr> <td>身高</td> <td><input name="height" id="idheight_cm" οnkeyup="CMtoFTInch(event);" type="text"> cm</td> <td> <input id="idheight_ft" οnkeyup="FTInchtoCM(event);" type="text"> ft <input id="idheight_inch" οnkeyup="FTInchtoCM(event);" type="text"> inch </td> </tr> </table> 输入框都标有id,然后按键弹起的时候出发相应的函数 function CMtoFTInch(evt){ //厘米转化为英寸 e