jQuery读取JSF中标签、属性的方法

jQuery读取JSF中标签、属性的方法

代码示例:

                <div id="switcher" class="switcher">
                    <h3 id="wol" class="wol">如果您点击我,我会消失。</h3>
                    <h:commandButton  class="wo" value="asdadsads" id="wo">
                    </h:commandButton>
                </div>

1.使用class来获取

如代码所示,可以及直接通过

jQuery(".wo").addClass('hidden');

来获取。

2.使用input[id]获取

 jQuery("input[id*='wo']").addClass('hidden'); 

3.通过使用input[type]获取

    jQuery( 'input[type=submit]').addClass('hidden');   

4.通过form:id获取

$('#formNmae\\:tagNmae')”  

注:可以去查看http://blog.csdn.net/cuiran/article/details/7661121

http://hi.baidu.com/newsyz/item/8704d2c0c56cfc5bbdef6992

posted @ 2013-08-30 10:11  bupt_ding  阅读(373)  评论(0)    收藏  举报