nodename

Replace Node Name

馋奶兔 提交于 2019-12-11 02:19:54
问题 Is it possible to replace a nodes name? Like: HTML: <strong id="element">Text</strong> Javascript: var element = document.getElementById("element"); element.nodeName = "b"; As I see it's not working, if it's not possible in this way, then how can it be done? Why I need it: I'm building a Text Editor, and IE uses strong instead of b in the execCommand() function and I would like to change that, I tried to build the execCommand("bold") from scratch but there is a lots of problem and differences

graphviz: subgraph has same node, how to unique

妖精的绣舞 提交于 2019-12-10 12:56:47
问题 I create dot file by my perl script. here is subgraphs which contains same node. eg: subgraph{aa->bb->cc;} subgraph{dd->bb->ee;} I know those subgraph use same namespace, so my result output is a mess. In each subgraph, I can make them unique, like bb and bb_1 below, subgraph{aa->bb->cc; bb_1->dd;} but it hard to make all node in all subgraphs unique. please help. if here is some methods to make each subgraph "strict" or use different namespace? 回答1: The label presented for a node is only

jquery nodename returning undefined

余生颓废 提交于 2019-11-29 15:59:17
问题 This code isn't for anything in particular. I'm just trying to successfully get the tagName or nodeName of an element. However, when I run the following code, I always get an alert saying "undefined". I'm wondering if it's because this function executes when the document is ready? Is there a different place I should be doing this? Or is it probably my other javascript code conflicting somehow (I would doubt). $(document).ready(function(){ $('#first').hover(function() { alert($('#last')