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
What is a callback url?
How do you disable javascript?
What are the seven data types of javascript?
How to read a cookie using javascript?
Which keywords are used to handle exceptions?
List different ways of empty an array in javascript?
How to create an object in javascript?
what are the difference unescape() and escape() functions?
What is the syntax of ‘self invoking function’? Give an example?
How can javascript be used to improve the "look and feel" of a web site? By the same token, how can javascript be used to improve the user interface?
What is the difference between the operators ‘==‘ & ‘===‘?
Write a way by which you can do something on the close of the window ?
How to convert a string to lowercase?
Difference between undefined and undeclared variables?
Why is my javascript function not defined?