Add attribute not working
Hello everyone, I am having some trouble adding an attribute in jquery to a select many checkbox in primefaces.
I done this function so far:
- $("div.ui-chkbox-box").live("click", function(){
- $parent = jQuery( $(this).parents(".ui-selectcheckboxmenu-panel") );
- var classes = $(this).attr("class");
- if(/ui-state-active/i.test(classes)){
- var temp = $parent.attr("id").replace(/\:/g,"\\\\:");
- var compId = "#" + temp.replace("_panel", "");
- $id = $(compId);
- if ($(compId).attr("title") === undefined){
- $id.attr("title", "Test");
- document.getElementById($parent.attr("id")).title = 'Test';
- } else {
- var tempTT = $id.attr("title");
- tempTT += " " + "Teste 2";
- $id.attr("title", tempTT);
- }
- } else {
- }
- })
Debbuging it, I can see it pass thru my validation, and line 14/15, even so, it is not adding the title to the object. If I copy the snippet that adds the title to the element in the console in chrome, it works perfectly.
That is only an example, i will stick to one way to do so, that one was an attempt with both js and jquery.
Any tips are welcome =)