jQuery reduces all values ββof the name attributes.
I have an HTML form:
<input type="text" name="firstName"> <input type="text" name="lastName"> <input type="text" name="amountForName">
Trying to read it and create xml with its value.
jQuery
$(section).find('input').each(function(i, field) { console.log($(field).attr('name'));//prints 'firstName' var $fieldName = $.createElement($(field).attr('name')); $fieldName.text($(field).val()); $.createElement = function(name) { console.log('Creating Element '+name); //prints 'firstName' return $('<'+ name +' />'); }
But a free wrapper appeared in the xml elements, and I get
<firstname>himanshu</firstname><lastname>yadav</lastname>
How can I save camel shell for node names?
source share