Try to expand on what you want. Give us a list of requirements spell out exactly what you want. I expect a couple of the down votes will be rescided if you do this.
For my part, try this:
<div id="details">
<script type="text/javascript">
$(document).ready(function(){
$("#details").mouseover(function(){
var $this = $(this);
$this.append("<div id='test'>"+$this.html()+"</div>");
});
})
</script>
To show/hide would have been simple call to .show()
or .hide()
If you really wanted this code:
var a='<div id="details" onmouseover="tip(this)">';
Then you would have to append to the DOM:
$(document).append('<div id="details">');
And then bind your event:
$("#details").mouseover(function(){