jq绑定:
$(document).on(
'click'
,
function
(e) {
consol.log(
'jquery事件绑定'
)
});
js绑定:
document.addEventListener(
'click'
,
function
(e) {
consol.log(
'原生事件绑定'
)
});
example:
change 事件绑定,class选择器为is-turn
$(document).on('change', '.is-turn', function(event) {
var o = $(this).parent().parent().parent().parent();tr = o.find( 'tr.old-jg' );
if( 1 == parseInt( $(this).val() ) ){
tr.show();
tr.find("input").attr("dataType","Require");
} else {
tr.hide();
tr.find("input").attr("dataType","");
}
});