开发者

updating value in html table via javascript

开发者 https://www.devze.com 2023-01-16 03:19 出处:网络
Hi is there any way to upadte cell value with no events (i dont want to use \'onClick\' or others)? The scheme is: user is filling form value, then clicks \'ok\', and then value should be showed in

Hi is there any way to upadte cell value with no events (i dont want to use 'onClick' or others)?

The scheme is: user is filling form value, then clicks 'ok', and then value should be showed in cell in html table ?

thx in advance fo开发者_开发百科r all help


Well, you can use a link with href="javascript:myFunction()" instead of an onclick, but I'm not sure if that counts as an event :)


No, you need to hook up on an even to trigger it.


Since the user is going to click the Ok link anyways that seems to be the most relevant place to invoke your javascript from.

  1. Create a div with an id around the content you would like to change.
  2. Create a javascript function that sets the innerHTML of the above div.
  3. Call the javascript function when the user hits the Ok link.
0

精彩评论

暂无评论...
验证码 换一张
取 消