2014-07-14 3 views
0

다음 링크에서 버튼 및 툴팁의 기존 클래스를 변경하고 싶습니다. 어떻게해야합니까?링크의 버튼에 클래스를 추가하는 방법

$("<a>") 
       .attr("tabIndex", -1) 
       .attr("title", "Show All Items") 
       .tooltip( //change class here) 
       .appendTo(this.wrapper) 
       .button({ 
         //change class here 
       }) 
       .removeClass("ui-corner-all") 
       .addClass("custom-combobox-toggle") 
       .mousedown(function() { 
        wasOpen = input.autocomplete("widget").is(":visible"); 
       }) 

.ButtonStyle { background-image: url('../Arrow_Down.gif'); margin: 0; border: outset; height: 22px; width: 20px; padding: 0; } 

당분간 렌더링되는 HTML은 다음과 같습니다. 변경하고 싶습니다.

enter image description here

+3

질문에 HTML을 추가하십시오. –

답변

1

클래스 사용 추가 :

buttonObj.addClass('class'); 

및 모든 클래스의 스타일 변경 : 일부 바이올린 또는 뭔가처럼 보여 경우

$('.tooltip').css({/* new css values*/}); 

그것은 더 나은 것을 그.

0

당신의 HTML을 가정 할 것은 다음과 같이이다 :

<form action="http://google.com"> 
    <input id="fooButton" type="submit" value="click me"> 
</form> 

귀하의 질의가있을 것입니다 :

$('#fooButton').on('click', function() { 
    $(this).addClass('fooClass'); 
}); 
관련 문제