javascript - YUI create div in every input[type=text] -


hi ~ pardon ignorance, i'm new yui3. create clear button in every input textbox. attempt create div , append every input text. attempt fail.

kindly need guidance here on code tried below..

thanks in advance!

yui().use("node", function(y) {      y.all('input[type=text]').each(function(node) {           var outerdiv = y.node.create('<div class="clrinput">x</div>');           outerdiv.setstyles({                 position:  absolute,                 left: node.get('offsetleft')+this.get('width')-10,                 top: node.get('offsettop'),                 width:node.get('width'),                 height:node.get('height')         })           node.appendto(outerdiv);       });    }); 

the reason why not seeing outerdiv never becomes part of dom. it's created, , input node appended it, outerdiv never added dom.

node.appendto(outerdiv); y.one('body').append(outerdiv); 

should solve that. check out your script line added.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -