-sharpbbox{
position: absolute;
top: 166px;
left: 219px;
background: -sharpfff;
width: 548px;
border: 1px solid -sharp999;
}
-sharpbbox -sharpseach-ul{
list-style: none;
}
-sharpbbox -sharpseach-ul li{
height: 50px;
line-height: 30px;
padding-left: 10px;
}
-sharpbbox -sharpseach-ul li:hover{
background: -sharpe5e5e5;
text-decoration: underline;
}
//body
<div id="bbox" style="display: none;">
<ul id="seach-ul">
</ul>
</div>
//script
$("-sharptxt").on("keyup", function (e) {
var text = $("-sharptxt").val();
var html = "";
html += "<li>" + text + "</li>"
$("-sharpseach-ul").html(html);
$("-sharpbbox").show();
});
Why is the previously set style missing after dynamically adding li