Html:<div class="container">
<input id="inputId" type="text" class="sousuo" />
<div class="search" style="height: 21px;"><img id="imgBtn" src="img/茶壶.jpg" width="36px"/></div>
</div>
Css:<style type="text/css">
.container{
position:relative;
}
.search{
position:absolute;
width:50px;
height:50px;
top:1.5px;
left:115px;
z-index:99;
}
</style>
jQuery:<script>
$(document).ready(function () {
$("#imgBtn").click(function ()
{
if ($("#inputId").attr("type") == "text") {
$("#inputId").attr("type", "password");
}
else
{
$("#inputId").attr("type", "text");
}
})
})
</script>