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.....

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Where is javascript used most?

924


How generic objects can be created?

924


Can you access Cookie using javascript?

989


What is the difference between "var" and "let" keywords?

936


Explain function hoisting in javascript?

890


Which operator is used to assign a value to a variable?

877


What is differential inheritance?

939


How do you clear an array in javascript?

933


How onclick works in javascript?

901


How much do javascript programmers make?

892


What do you mean by script?

868


What is use of object as function?

1063


How to get height and width of different browser in Javascript?

946


What is meant by vanilla javascript?

957


Can an anonymous function be assigned to a variable?

914