开发者

how to add cursor type on a table row using javascript?

开发者 https://www.devze.com 2022-12-09 18:40 出处:网络
var tbl = document.getElementById(TABLE_NAME); var nextRow 开发者_JAVA技巧= tbl.tBodies[0].rows.length;
 var tbl = document.getElementById(TABLE_NAME);    
 var nextRow 开发者_JAVA技巧= tbl.tBodies[0].rows.length;
 row.setAttribute('style', "cursor: pointer;");

This will add double click event on table row.right..!!!But i m facing problem in internet explorer.working perfect in all other browsers. For adding style i am handling this:

var cell2 = row.insertCell(1);
var browser=navigator.appName; if(browser == "Microsoft Internet Explorer") 
{            
   cell2.style.setAttribute("cssText", "color:black; width:300px;");
}
else
 { 
   cell2.setAttribute("style", "color:black; width:300px;");
 }

how to add double click event which will work on internet explorer too...


Use:-

cell2.style.cssText = "color:black; width:300px;"

for IE.


enter code here
 var cell2 = row.insertCell(1);
 var browser=navigator.appName; if(browser == "Microsoft Internet Explorer") 
 {            
  cell2.style.setAttribute("cssText", "color:black; width:300px; cursor:pointer;");
 }
 else
 { 
  cell2.setAttribute("style", "color:black; width:300px; cursor:pointer;");
  }

will set my cursor pointer... LOL anyways thanks friends..

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号