How can I know the id of a JSF component so I can use in Javascript

前端 未结 6 1342
北海茫月
北海茫月 2020-11-22 02:47

Problem: Sometimes you will want to access a component from javascript with getElementById, but id\'s are generated dynamically in JSF, so you

6条回答
  •  别那么骄傲
    2020-11-22 03:32

    You can view the HTML source when this is generated and see what the id is set to, so you can use that in your JavaScript. As it's in a form it is probably prepending the form id to it.

提交回复
热议问题