troubleshooting Question

Jquery does not work

Avatar of TheCommunicator
TheCommunicatorFlag for United States of America asked on
JavaScriptASP.NETJScript
8 Comments1 Solution409 ViewsLast Modified:
Hello,

I have a MVC application and I want to make my table row clickable and then when I hover over it, I want to  change the background of it.

I hvae following code that I got from some blog

<script type="text/javascript">
    $(document).ready(function () {
        $('.simplehighlight').hover(function () {
            $(this).children().addClass('datahighlight');
        }, function () {
            $(this).children().removeClass('datahighlight');
        });
    });

    $(document).ready(function(){    $("tr").click(function(){  window.location = $(this).attr("url");     }); }); 



     });
    });


</script>


My HTMl code is as follows:

table id="resultTable" border = "2">

    <tr style="border-style:solid"  class="simplehighlight">
        <th>
            Name
        </th>
        <th>
            Description
        </th>
        <th>
            tblStatu
        </th>
        <th>
            DueDate
        </th>
        <th>
            AssignedTo
        </th>
        <th>
            CreatedOn
        </th>
        <th>
            CreatedBy
        </th>
        <th>
            ModifiedOn
        </th>
        <th>
            ModifiedBy
        </th>
        <th></th>
    </tr>

That just does nto seem to work...... What can be wrong in this code?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros