是否可以做到鼠标移动到<a href="www.baidu.com" title="baidu" onclick="search.php" target="_blank">baidu</a>时,title里的文字“baidu”不显示在超链位置,而显示到指定位置的DIV里面?
注:a href和onclick都已经用满了 :(

解决方案 »

  1.   

    onmouseover="document.getElementByID('指定divID').innerText='指定内容'"
      

  2.   

    onmouseover="document.getElementByID('指定divID').innerText=this.title"
      

  3.   

    回3楼,只能把 '指定内容'放在innerText里吗?还有没有别的方法?
    我用的是PHP,<a href="www.baidu.com" title="baidu" onclick="search.php" target="_blank">baidu</a>写在了function函数里面。
    如果a href是数据库结果,JS代码是不能插进function代码里的吧。
      

  4.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script type="text/javascript" src="jquery-1.2.6.js"></script>
    <script type="text/javascript">
    $(function(){
    var x=10;
    var y=20;
    $("a").mouseover(function(e){
    this.myTitle=this.title;
    this.title="";
    var tooltip="<div id='tooltip'>"+this.myTitle+"<div>"
    $("body").append(tooltip);
    $("#tooltip").css({"top":(e.pageY+y)+"px","left":(e.pageX+x)+"px"}).show("fast");
    }).mouseout(function(){
    this.title=this.myTitle;
    $("#tooltip").remove();
    });
    })
    </script>
    </head><body>
    <a href="" title="baidu" >hello</a>
    </body>
    </html>不知道楼主用JQuery了没有,看看这个对你有帮助没,可以通过样式来改div的位置和外观!