naanace
naanace

Reputation: 363

How to get alert text in jQuery?

I called 'alert' box from C#

Response.Write("<script>alert('Click Checkbox'); </script>");

and I want to get this text from 'alert' box in jQuery. Text what I want is 'Click Checkbox'. How can I get it?

Upvotes: 1

Views: 783

Answers (1)

Milind Anantwar
Milind Anantwar

Reputation: 82241

You should rather set a variable from code behind and access the value. contents of alert do not have the scope of accessing it.

Response.Write("<script>var alerttext='Click Checkbox'; alert('Click Checkbox'); </script>");

Upvotes: 2

Related Questions