解决方案 »

  1.   


    var str = '<row id="5" class="listtable_selline" onmouseover="moveover(this);" title="" ondblclick="fi_selreturn();" onmouseout="moveout(this);" onclick="select_line(this);return;" 顶级部门代码="" 顶级部门名称="董事长" 顶级部门ID="1" query_deptnames="财务部" pos_deptname="财务部" pos_deptid="10" email="" postcode="" address="" city="" province="" hometel="" fax="" tel="" foreignlan2level="" foreignlan2="" foreignlan1level="" foreignlan1="" graduate="" college="" speciality="" education="" party="" stature="" registerplace="" nation="" nativeplace="" comdate="" birthday="" idcard="" p_id="5" desktop_id="" menu_id="" pwd="ZXnXtPxjOsQ=" islogin="1" isactive="1" comage="" mobile="" age="" title_name="" title_levelno="" title_id="" account="yilh" shortname="" position_id="5" dept_id="10" org_id="1" null=" " code="" name="兰花" dept_name="财务部" position_name="会计" sex="女"/>'$(str).attr('name')
      

  2.   

    <script type="text/javascript" src="http://code.taobao.org/svn/kingfishers/trunk/jslogger/logger.js" skinid=0></script>
    <script>
    function select_line(o){
    //取得指定属性
    var name = o.getAttribute("name");
    var dept_name = o.getAttribute("dept_name"); $alert(name+" "+dept_name)

    //取得所有自定义属性
    var sb="";
    for(var k =0;k<o.attributes.length;k++){
    var ob = o.attributes[k];
    if(ob.expando){
    sb+=k+" - "+ob.nodeName +":"+ob.nodeValue+"\n";
    }
    }
    $alert(sb)

    }
    </script><row id="5" class="listtable_selline" onmouseover="moveover(this);" title="" ondblclick="fi_selreturn();" onmouseout="moveout(this);" onclick="select_line(this);return;" 顶级部门代码="" 顶级部门名称="董事长" 顶级部门ID="1" query_deptnames="财务部" pos_deptname="财务部" pos_deptid="10" email="" postcode="" address="" city="" province="" hometel="" fax="" tel="" foreignlan2level="" foreignlan2="" foreignlan1level="" foreignlan1="" graduate="" college="" speciality="" education="" party="" stature="" registerplace="" nation="" nativeplace="" comdate="" birthday="" idcard="" p_id="5" desktop_id="" menu_id="" pwd="ZXnXtPxjOsQ=" islogin="1" isactive="1" comage="" mobile="" age="" title_name="" title_levelno="" title_id="" account="yilh" shortname="" position_id="5" dept_id="10" org_id="1" null=" " code="" name="兰花" dept_name="财务部" position_name="会计" sex="女"/> asdfasdf