benjoe Posted May 6, 2021 Share Posted May 6, 2021 I have an html page with an image src and I want to pop up the image as an alert on page first load in mvc layout . I am struggling to get the popup working. Below is my html code <!DOCTYPE html> <html> <head> <title>CUI Page</title> <meta charset="utf-8" /> <script src="/Scripts/jquery-1.10.2.min.js"></script> <link href="/Content/bootstrap.min.css" rel="stylesheet" /> <script src="/Scripts/bootstrap.min.js"></script> </head> <body> <div class="container"> <div class="col-md-12" id="hide"> <img src="/Content/Images/warning.png" style="margin-left: auto; margin-right: auto; display: block;" alt="" /> <button autofocus id="myButton" type="button" style="margin-left: auto; margin-right: auto; display: block;">OK</button> </div> </div> </body> </html> <script> $("#myButton").on('click', function () { $("#hide").hide(); </script> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.