gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
make a button element tag that opens a javascript:alert(1) page without using href
- User
make a button element tag that opens a javascript:alert(1) page without using href
- Assistant
Here is an example of a button element tag that opens a JavaScript alert page without using href:
<button onclick="javascript:alert(1)">Open Alert</button>When the button is clicked, it executes the JavaScript code
alert(1)inside theonclickattribute, causing the alert dialog box to be displayed with the message "1".