Convert pure javascript to jquery -
i want convert pure javascript jquery, code lines containing specified search text removed. here code:
my code on 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 understand word's meaning need more definition. @ dictionary try give of tools need understand word means. seeing word in sentence can provide more context , relevance.</textarea> <textarea id="removed_box" rows="4" style="width:100%; margin-top:10px; height:150px; resize:none;" wrap="off"></textarea> </body> </html>
in jquery
here's how call element;
instead of
document.getelementbyid('addfield0')
just use
$('#addfield0')
example when getting value:
$('#addfield0').val()
note: make sure reference jquery
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
Comments
Post a Comment