Create a simple button using Javascript

Hi All,

I would like to know whether it is possible to create a simple button using javascript. i know that text fields can be created using Javascript. any help would be great.


1 Reply

AS Aravinthan Seetharaman Syncfusion Team September 9, 2021 02:40 AM UTC

Hi shaw, 
 
Thanks for contacting Syncfusion Support. 
 
We have checked your query. We can able to create Button using Javascript. Please refer the below code snippet. 
 
 
var btn = document.createElement('BUTTON'); 
btn.innerHTML = 'Button'; 
btn.id = 'primarybtn'; 
document.body.appendChild(btn); 
var button = new ej.buttons.Button({ isPrimary: true }); 
button.appendTo('#primarybtn'); 
 
 
 
For more details, please refer the below UG link. 
 
 
 
Could you please check the above details, and get back to us, if you need assistance on this. 
 
Regards, 
Aravinthan S 


Loader.
Up arrow icon