Adding a tag to a JQuery object -
i trying dynamically create objects using jquery. have json object elements want pull , add onto object. far i've been using line , getting text on object:
$(this.node).find('a').text(dict.get('text1')); i want add second object, "text2", paragraph tag. function add tags jquery object in similar manner how i've been adding text?
edit: want end object has 2 paragraph tags can add class/id tags to
you need .append() function:
description: insert content, specified parameter, end of each element in set of matched elements.
if want add paragraph, can this:
var $p = $("p"); $p.text("this paragraph text."); $(".container").append($p); also here find insertion-inside functions.
Comments
Post a Comment