将纯javascript转换为jquery
Convert pure javascript to jquery
我想将纯javascript转换为jquery,这段代码是关于包含指定搜索文本的所有行都将被删除。这是我的代码:
我在jsfiddle上的代码:http://jsfiddle.net/v306rzhg/4
<body>
Search lines for:
<input type="text" id="addfield0" value="Sometimes|relevance|understand" style="width:100%; margin-top:10px;" />
<input type="button" style="margin-top:10px;" value="Remove Lines Containing..." onClick="if(document.getElementById('addfield0').value!='') {removelines('containing');}" />
<input type="button" value="Not Containing..." onClick="if(document.getElementById('addfield0').value!='') {removelines('notcontaining');}" />
<textarea id="input_output" style="width:100%; margin-top:10px; height:150px; resize:none;" wrap="off">Sometimes to understand a word's
meaning you need more than a definition.
At Your Dictionary we try to give you all of the tools
you need to really understand what the word means.
Seeing the word in a sentence can
provide more context and relevance.</textarea>
<textarea id="removed_box" rows="4" style="width:100%; margin-top:10px; height:150px; resize:none;" wrap="off"></textarea>
</body>
</html>
在Jquery
中
以下是如何调用元素;
而不是
document.getElementById('addfield0')
只需使用
$('#addfield0')
获取值时的示例:
$('#addfield0').val()
注意:确保您引用了您的jquery
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
在此处向下查询
相关文章:
- js代码从jQuery转换为原生代码
- 将jQuery转换为用户脚本的普通Javascript时遇到问题
- 将jquery转换为javascript,以便能够在greatemonkey上运行
- 将简单的jQuery转换为JavaScript
- 将 jQuery 转换为等效的 JavaScript 代码
- 抓取表数据并使用jQuery转换为无序列表
- 将jQuery转换为Angular,固定侧边栏不起作用(?)
- 将 Jquery 转换为角度或使 Jquery 以角度工作
- 将函数从jQuery转换为Mootools
- jQuery 转换未完成
- 如何使用jQuery转换所有带有动态类的内联样式css
- 我怎样才能把它从jQuery转换为vanilla JS
- 将 Jquery 转换为 Motools
- 带有nav元素的jQuery转换的Javascript
- 将jquery转换为Angularjs
- jQuery转换的代码不起作用
- 如何将函数从Jquery转换为Javascript
- 引导程序'选择'样式,使用jquery转换为bootstrap下拉列表
- 将代码从jquery转换为纯javascript
- 将JQuery转换为JavaScript