Home  >  Article  >  Web Front-end  >  js/jQuery对象互转(快速操作dom元素)_javascript技巧

js/jQuery对象互转(快速操作dom元素)_javascript技巧

WBOY
WBOYOriginal
2016-05-16 17:42:32886browse
复制代码 代码如下:

// jquery对象转js对象
$('#search')[0].checked=true;
// js对象转jquery对象
var obj = document.getElementById('search');
alert($(obj).checked);
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn