0
我正在设计一个笔记应用程序,并且在使用JQuery添加多个笔记时遇到了问题。我设计的方式相对简单,在粘滞便笺的图像上叠加了一个文本框。为了生成新的笔记,这里是我用于图像的代码。JQuery添加一个HTML文本框
function addEvent() {
var ni = document.getElementById('myDiv');
var numi = document.getElementById('theValue');
var num = (document.getElementById("theValue").value -1)+ 2;
numi.value = num;
var divIdName = "my"+num+"Div";
var newdiv = document.createElement('div');
newdiv.setAttribute("id",divIdName);
newdiv.prepend = "<img src='Sticky_Note.png'</a>";
ni.appendChild(newdiv);
var newtext = document.createElement('Note')
newdiv.prepend = "<input type="textarea" rows="3" cols="25" x-webkit-speech="x-webkit- speech" style="width:380px;height:300px; background: none; border:none; font-size:24px; color:#0033FF;font-family:comic sans ms " />";
ni.appendChild(newtext);
但是文本框不显示! 我应该怎么做才能修复它?
It's plain Javascript。no jQuery at – gdoron 2012-02-26 00:28:45
put the associated html too – uday 2012-02-26 00:30:24