oop - create dynamic object in jquery -
i want create dynamic object in jquery , use :
var list=array(); var object={id,name}; $.each(....){ //some code $.each(...){ object o=new object(); o.id=$(this).val(); } //some code $.each(...){ object o=new object(); o.id=$(this).val(); } //some code }
how?
[edited]
i want create instance object created dynamically example create object :
x { id, value, state, name }
and later use it:
x sample=new x(); x.id=2; x.name="taghi"; x.state=true; x.value=3;
using jquery can create tags way.
$(document).ready(function () { var inputelement; (i = 0; < 10; i++) { inputelement = $("<input/>", { class: "btn", id: "btn" + i, value: "click" }); $("body").append(inputelement); } });
take example. change tag names according need
Comments
Post a Comment