針對某特定相同id設定JavaScript的event

針對某特定相同id設定JavaScript的event

如果使用JavaScript產生物件(例如<td>)
無法直接給訂指定的動作(例如onclick)設定程式
但是可以專門為網頁中的某個id撰寫固定的事件

方式如下

--------------------------------------------------------------------------------

例如要針對所有的id為dytd的物件作處理,可以用

//.....
</Scirpt>

 


以下是簽名:


Microsoft MVP
Visual Studio and Development Technologies
(2005~2019/6) 
topcat
Blog:http://www.dotblogs.com.tw/topcat