I created a class for creating html inputs, ie createButton(). Below one is the class for creating optional parameters like onclick, style, class etc. I tried to pass the style, class and onclick parameters. but onclick dosen't work because of strings arrangements. Single quotes and double quotes are all confusing me.
$cmsform->setOption("style='margin-left: 10px !important;' class='submit' onclick='return confirm('Are you sure you want to delete this staff?')");