Answers for "how to create <button> in jquery"

0

jquery create a button

$('#container').append(
    $(document.createElement('button')).prop({
        type: 'button',
        innerHTML: 'Press me',
        class: 'btn-styled',
		click: function () { alert('hi'); }
	})
);
Posted by: Guest on June-10-2021
-1

jquery html button

$(function(){
    $('button').on('click',function(){
        var r= $('<input type="button" value="new button"/>');
        $("body").append(r);
    });
});
Posted by: Guest on September-23-2021

Code answers related to "how to create <button> in jquery"

Browse Popular Code Answers by Language