Social Reiot

Social Game Developer wandering in strange dungeon.

Non Labeled Checkbox & Radio Can't Be Jquery Button

label 태그가 없는 checkbox 는 jquery ui button 으로 감싸면 아무리 label 옵션을 줘도 안보인다. 

왜냐하면 jquery.ui.button 코드가 이렇게 때문에

if ( this.type === checkbox || this.type === radio ) {

// we dont search against the document in case the element

// is disconnected from the DOM

this.buttonElement = this.element.parents().last()

.find( label[for= + this.element.attr(id) + ] );

따라서 버튼으로 만들려면 무조건 id 를 주고 label 태그를 지정해야 한다.

Comments