How to convert a javascript string into a html object using jQuery

$(var)

If we want to convert string tag to an html object we can do it using a jQuery function like this.

Javascript:

var stringTag  = '<input type="text" name="nameInput" id="idInput" />';
var htmlObject = $(stringTag);

And we could take this object and use it as an object.
Reference link: http://stackoverflow.com/questions/2522422/converting-a-javascript-string-to-a-html-object

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s