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
How to convert json string to object?
How to trigger a postback on an updatepanel from javascript?
What is the difference between scripting and programming?
What is the difference between script type and the script language attributes?
How to comment javascript code?
Can you assign an anonymous function to a variable?
List some of the disadvantages of javascript.
What is the difference between innerhtml & innertext?
What is console.time() and console.timeend()? What is its syntax, and why is it used?
What is the use of a weakmap object in javascript?