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 will happen and why if i will acess the methods of superclass which is declared as private by a object of same subclass.
How to write normal text code using JavaScript dynamically?
Is html and javascript the same?
What is the use of a number object in javascript?
Is Javascript a Functional Programming Language?
What is 'use strict'?
Write JavaScript code to use file system in binary format?
what is flux in javascript?
I am providing the Online& class room training on Worksoft Certify for SAP/HTML/JAVA using real time scenarios in a real time environment for a real time project, If any one is interested please get in touch with me on aimansaud@gmail.com
Difference Between JavaScript and ECMAScript?
how do you declare variables in javascript?
Explain the typeof operator?
How we can get the value of an element using javascript?
What is strict mode?
What does 3 dots mean in javascript?