$('#add-to').click(function(e){
addNewLine(e,this.id);
});
the above code works when i click the particular element with id add-to
now I need to automatically trigger this click even and call the same method (addNewLine(e,,this.id)) on click with parameters on loading the page .
Thanks for helping.
Refer Here
$('#add-to').click()or$('#add-to').trigger('click')on page load it will fire click event