Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Can we create buttons in JavaScript ? if yes how? pls provide
sample code... Thanks in advance.....



Can we create buttons in JavaScript ? if yes how? pls provide sample code... Thanks in advance......

Answer / stardev24

We can create in multiple ways.Here I am doing by using jquery

HTML:
<div id="target">
<button id="CreateButton">Create button</button>
</div>

JAVASCRIPT:
$(document).ready(function () {
$("#CreateButton").click(
function () { $('#target').append('<button>button created</button>')
}
);
});

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More JavaScript Interview Questions

How do I view javascript files in chrome?

0 Answers  


Are Typescript and Javascript the same?

0 Answers  


Does html5 replace javascript?

0 Answers  


Explain javascript event delegation model?

0 Answers  


What is the difference between a web-garden and a web-farm?

0 Answers  


Does javascript support automatic type conversion, if yes give example.

0 Answers  


Name some of the JavaScript features?

0 Answers  


What is a function callback?

0 Answers  


What is a name function in javascript & how to define it?

0 Answers  


Auto insurance project..How to explain project in interviews.Using Automation tool (selenium).

0 Answers  


Explain the difference between “==” and “===”?

0 Answers  


What is the difference between let and var?

0 Answers  


Categories