Jump to content

Need help making a DIV clickable


Hobbyist_PHPer

Recommended Posts

I have been having problems with making a DIV clickable... To rule out any other possibilities, I created a test.php page and it still won't fire when I click on the DIV... The code follows... Can someone please tell me what I'm doing wrong?

 

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script src="http://code.jquery.com/jquery-latest.js"></script>
        <script>
            $("#TestDiv").click(function() {
            alert("Handler for .click() called.");
            });
        </script>
        <title>Test</title>
    </head>
    <body>
        <div id="TestDiv" style="width: 100px; border: 1px #000 solid;">
             Click Here
        </div>
    </body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/268165-need-help-making-a-div-clickable/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.