I've recently gotten my first ID job as a PHP programmer but one of the tasks that bites my is JS/jQuery, I don't know JS/jQuery but now i'm having to use it. I'm taking a course on udemy.com but I'm having issues, sometimes the code executes and sometimes noting happens at all, my browser will have absolutely no response. I've just tried the following code with no response whatsoever from either Brave or Google Chrome. Any ideas what could be going wrong here? Thanks.

 <!DOCTYPE html>

<html>

<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> 
<script>
    $(documenet).ready(function(){
        $('p').click(function(){
            $(this).css('color', 'red');
        });

        $('li').dblclick(function(){
            $(this).css('color', 'red');
        });
    });
</script>
</head>

<body>

    <h1 id="title">title</h1>

    <p class="paragraph">Paragraph text 1</p>
    <p class="paragraph">Paragraph text 2</p>

    <input type="text"></input>

    <ul>
        <li>List element 1</li>
        <li>List element 2</li>
        <li>List element 3</li>
        <li>List element 4</li>
        <li>List element 5</li>
    </ul>

</body>

</html>

Recommended Answers

All 4 Replies

Hi, document is spelt wrong!

$(document).ready(function(){
commented: I'm a morron! +6

Correct the selector: $(document).ready(function() { ...
You wrote $(documenet)

commented: The obvious got me. +6

Can I mark this question as solved? Or does it still not work?

commented: I'm pretty sure it's solved, looks ok to me +0
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.