Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8963021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:16:04+00:00 2026-06-15T16:16:04+00:00

The past 3 days I’ve tried to get this simple example to work but

  • 0

The past 3 days I’ve tried to get this simple example to work but whatever I try I just can’t seem to understand where I’m going wrong…

HTML:

<input type="text" id="textEntry" /> <button>Go</button>
<ul id="list">
    <li>Text from the input field will appear below</li>
</ul>

jQUERY:

$('button').click(function() {
    $enteredText = $('#textEntry').val();

    if($enteredText.length === 0) {
        alert('PLace an item in the field box');
    } else {        
        $newListItem = $('<li/>').html($enteredText).appendTo('#list');
    }

});

$('li').live('mouseover mouseout', function(event) {
    if(event.type == mouseover) {
        $(this).css('background-color', 'yellow');
    } else {
        $(this).css('backgorund-color', 'transparent'); }
});

Ultimately what I’m looking to do is have a user input an item into the text field which would then append itself to the existing list (this works – no issues). The user can then hover over a specific entry causing the background to turn yellow on mouseover and transparent on mouseout (the issue).

Any help would be swell.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T16:16:05+00:00Added an answer on June 15, 2026 at 4:16 pm

    The event.type gives you name of event in string so mouseover should be "mouseover".

    $('li').live('mouseover mouseout', function(event) {
        if(event.type == "mouseover") {
            $(this).css('background-color', 'yellow');
        } else {
            $(this).css('backgorund-color', 'transparent'); }
    });
    

    Edit backgorund-color should be background-color

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have spent the past three days researching this... but Im still stuck. I
Been fighting with Linux for the past few days. For whatever reason I can't
I've been banging my head against this for the past two days and can't
I have been trying for the past four days to get this working. It's
I have spent the past 2 days wondering why this is not working, but
I've spent the past two days just trying to enable the sending of email
I am learning Python for the past few days and I have written this
For the past 2 days I've been stuck on a violation which I can't
for the past four days I am trying to understand the dijkstra's algorithm. But
Hello I'm stuck on this past few days with searching a lot, now I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.