0
我從來沒有使用jQuery的之前,我是我如何從onclick
調用按鈕的下面的函數與textarea
如何調用一個jquery
功能
$(document).ready(function() {
$('#demo1').highlightTextarea({
words: {
color: 'red',
words: ['N/A','n/a']
},
debug: true
});
一個例子上班我看的代碼如下:
HTML代碼
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.min.js"></script>
<link href="css/jquery.highlighttextarea.css" rel="stylesheet">
<script src="js/jquery.highlighttextarea.js"></script>
</head>
<body>
<textarea rows="4" cols="50">
This is a example n/a of all the following N/A
Thanks
</textarea>
<button type="button" onclick= >Call function </button>
<script type='text/javascript'>
$(document).ready(function() {
$('#demo1').highlightTextarea({
words: {
color: 'red',
words: ['N/A','n/a']
},
debug: true
});
});
</script>
</body>
</html>
感謝您的幫助,提前
你爲什麼要改變什麼? 我問過我想要的問題,而穆罕默德 - 尤瑟夫向我提供了我正在尋找的解決方案! –