开发者

How to add <font> with Javascript?

开发者 https://www.devze.com 2022-12-30 09:22 出处:网络
FM_log(3,\"rp_insertTable() called\"); var farmTable = dom.cn(\"table\"); var ftableBody = dom.cn(\"tbody\");
FM_log(3,"rp_insertTable() called");

 var farmTable = dom.cn("table");

 var ftableBody = dom.cn("tbody");

 var i;

 var maximize = 开发者_Python百科GM_getValue("Maximize_" + suffixGlobal, 0);

 farmTable.className = "FMtbg";

 farmTable.id = "farmMachineTable";

 farmTable.setAttribute('cellpadding', 2);

 farmTable.setAttribute('cellspacing', 1);

 farmTable.style.marginBotton = "12px";

how can I add to that table, I mean, edit the HTML in the middle of that table and add "< font >" ??? (ps: how can I add < > code here without it being interpreted as code?)


To set the font name via javascript, set the .style.fontFamily attribute. For the size it's .style.fontSize

PS: Never ever use <font> - it's deprecated and a bad practice.

0

精彩评论

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

关注公众号