我想顯示消息「搜索」在ID爲「搜索」的字段中,並讓用戶點擊時消失。這是我的代碼。它不起作用。問題自定義<input type =「search」...> jquery移動
<script>
$('#acceuil').live('pagecreate',function(event){
$('#search').blur(function(){
if ($('#search').val()=='')
$('#search').val("search");
});
$('#search').focus(function(){
if (('#search').val()=='search')
$('#search').val("");
});
});
</script>
<div data-role="page" id ="acceuil" >
<div data-role="header" data-theme="a" ><h3>TEST</h3></div>
<div data-role="content">
<div data-role="container" >
<img src="images/olampromo.gif">
</div>
<div data-role="container">
<label for="search">Cherchez votre coupon :</label>
<input type="search" id="search" value="search">
</div>
</div>
<div data-role="footer" data-theme="a" ><h3>footer</h3></div>
大謝謝 –