menuPaneToBe.title = document.createElement("div");
$(menuPaneToBe).append(menuPaneToBe.title);
console.log(1)
console.log(menuPaneToBe.title)
$(menuPaneToBe.title).addClass("menuTitle");
console.log(2)
$(menuPaneToBe.title).html("Title"); //Just placeholders, gets changed by circular-view
console.log(3)
控制台时奇怪的JavaScript/JQuery的行为创建一个div元素
1 MenuPane.js:12
[object HTMLDivElement] MenuPane.js:13
Uncaught Error: Syntax error, unrecognized expression: [object HTMLDivElement] jquery-1.11.0.min.js:2
为什么是冠军只是[对象HTMLDivElement]而不是一个合适的对象?为什么我不能设置课程? MenuPaneToBe是一个设置为显示块的自定义标记。
<menu-pane id="menu"></menu-pane>
menu-pane {
display: block;
height: 100%;
width: 30%;
border-left: 1px solid black;
}
是什么'menuPaneToBe'? –
menuPaneToBe的值?提供更多的代码,提供html –
参见http://jsfiddle.net/arunpjohny/K9UM8/1/ –