Can we create buttons in JavaScript ? if yes how? pls provide
sample code... Thanks in advance.....
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 |
How do I view javascript files in chrome?
Are Typescript and Javascript the same?
Does html5 replace javascript?
Explain javascript event delegation model?
What is the difference between a web-garden and a web-farm?
Does javascript support automatic type conversion, if yes give example.
Name some of the JavaScript features?
What is a function callback?
What is a name function in javascript & how to define it?
Auto insurance project..How to explain project in interviews.Using Automation tool (selenium).
Explain the difference between “==” and “===”?
What is the difference between let and var?