Frappe.ready function is not executing when invoking from html on click event

function Test(){
alert("121");
frappe.ready(function() {
alert("123");

});
}`

I am calling the Test function from html form submit. the function is executing but the alert inside the frappe.ready function is not executing.

Please help.