[英]Jquery plugin stops placeholder to appear
好的,所以我有一個jquery標簽插件,可以很好地工作,但是后來我想起來,在我的文本框中添加一個“占位符”會很酷。 我這樣做了……除了jquery插件外什么都沒有出現……我的占位符應該是“ hello type here”……我猜它不起作用,因為該插件位於“ script”標簽之間...如果有人可以幫助我,我將非常感激:)
<html>
<head>
<script src="jquery-1.11.1.min.js"></script>
<script src="jquery-ui.js" type="text/javascript" charset="utf-8"></script>
<script src="tag-it.js" type="text/javascript" charset="utf-8"></script>
<link href="jquery.tagit.css" rel="stylesheet" type="text/css">
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<form name="myForm" action="searchlevel.html" method="post">
<p id="text">Sport:</p>
<input type="text" name="query" id="box" placeholder="hello type here! ">
<input type="submit" value="Submit" id="but">
</form>
</body>
<script>
//this is jquery tag plugin...
$(document).ready(function () {
$("#box").tagit();
});
// I guess I have to add something here to display the "placeholder", please help.
</script>
</html>
阿羅哈,你的伴侶!
為什么要使用tagit javascript和CSS作為占位符。 刪除該腳本並簡單地使用它就可以了,但是記住它唯一的創建問題是在IE <9中使用它
看看這里可能對您有幫助
JSFiddle
測試在這里
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.