161
rated 0 times
[
164]
[
3]
/ answers: 1 / hits: 27737
/ 13 Years ago, thu, february 23, 2012, 12:00:00
Using jquery is it better to create a DOM element like this:-
function create(options)
{
$('<form action=' + options.action + '></form>');
}
Or like this:
function create(options)
{
$form = $('<form></form>');
$form.attr('action',options.action);
}
This may be a matter of opinion. I feel that the second way gives more clarity but I suspect it is less efficient...
More From » jquery