국비지원학원/Javascript

11.15정리 (jquery 기초)

Shakin 2021. 11. 16. 09:11

addEnvetListener = .on
getElementById = #
.value = .val()
$ = jquery호출
getElemnetByName = 'input[name=Name]'


<option value='Hi'>Hello</option>


console.log($('#selRegion').val()) << value값 호출 //Hi 호출
console.log($('#selRegion selected').text <<고른것의 text값 호출 // Hello 호출

'tag명 : tpye명 [name=name명]'
(input:checkbox[name=interest]').each(functuin(){
consol.log(this.id);
}
});

 

 

$(document)
.on('click','#btnShow',function(){
    str=$('#txtName').val(); //str = document.getElementById('txtName').value;
    $('#txtName1').val(str); //document.getElementById('txtName').value = str
    //$('#txtName').val() = str; 이거 절대아님

});