This article describes the effect of implementing simple Tip prompt box in JavaScript. Share it for your reference, as follows:
// JavaScript Documentdocument.write("<div id='tip' style='position:absolute; width:300px; z-index:1; background-color: #ffffff; border: 1px solid gray; overflow: visible;visibility: hidden;font-size:12px;padding:12px;color:#333333'></div>")function showtip(w){ var x=event.x; var y=event.y; tip.innerHTML=w; tip.style.visibility="visible"; tip.style.left=x+10; tip.style.pixelTop=y+document.body.scrollTop+10;}function hidden(){ tip.style.innerHTML="" tip.style.visibility="hidden";}Save the above as: showtip.js
<table cellpacing="0" cellpadding="0" background="#F7F7F0"><td background="images/line-dot.gif" align="left"><IMG src="images/dot2.gif"><a onmousemove="showtip('<b>Title:</b><br>Graduate girls are more confident than the packaging<br>')" onmouseout=hidetip() href='Common/NewsDetails.aspx?id=1035' target=_blank> Graduate girls are more confident than the packaging</a></td></tr><tr><td background="images/point_h.gif"></td></tr></table>For more information about JavaScript related content, please check out the topics of this site: "Summary of JavaScript switching effects and techniques", "Summary of JavaScript search algorithm skills", "Summary of JavaScript animation effects and techniques", "Summary of JavaScript errors and debugging techniques", "Summary of JavaScript data structures and algorithm skills", "Summary of JavaScript traversal algorithms and techniques", and "Summary of JavaScript mathematical operations usage"
I hope this article will be helpful to everyone's JavaScript programming.