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

  • Home
  • SEARCH
  • 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 7512867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:00:14+00:00 2026-05-30T00:00:14+00:00

I am doing a javascript script that work like bookmark. After allot of code

  • 0

I am doing a javascript script that work like bookmark. After allot of code i need to click in one of the divs I got but i can’t get it. If I put mouseover it works but no with click

I am using query

js:

var $j = jQuery.noConflict();
  $j('<div></div>').prependTo($j(this)).attr('id', 'shadow').css({
                'height': '220px',
                'width': '220px',
                'background-color': 'black',
                'position': 'absolute',
                'top': 0,
                'left': 0,
                'opacity': 0.4,
                'cursor': 'pointer'
            }).click(function() { //this dons't work i try to put apart
                                   //But if I put bind('mouseover' it works
                alert('a');
                //...more stuff

            });

In my HTML code its get like this:

<div id="div0" class="div" style="position: relative; ">
     <div id="shadow" style="height: 220px; width: 220px; background-color: black; position: absolute; top: 0px; left: 0px; opacity: 0.4; cursor: pointer; "></div>
     <img class="select" id="select0" src="url..." onclick="alert('aaa')">
     <img src="url..." class="img" id="img0" height="62" width="220" style="margin-top:79px"></div>
</div>

I put an alert directly to the image and it doesn’t work neither

Thanks for all the help

  • 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-05-30T00:00:15+00:00Added an answer on May 30, 2026 at 12:00 am

    Assuming that you’ve setup a shortcut for jQuery to be $j, I’ve created a sample jsFiddle:

    http://jsfiddle.net/TxKPD/

     $('<div></div>').prependTo('body').attr('id', 'shadow').css({
                'height': '220px',
                'width': '220px',
                'background-color': 'black',
                'position': 'absolute',
                'top': 0,
                'left': 0,
                'opacity': 0.4,
                'cursor': 'pointer'
            }).click(function() { //this dons't work i try to put apart
                                   //But if I put bind('mouseover' it works
                alert('a');
                //...more stuff
    
            });
    

    Since it wasn’t clear what $(this) was in your query i simply appended your element to the body. Everything is working with the click handler. So that leaves the question, what is triggering your script and what is $(this) ?

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

Sidebar

Related Questions

I have a Control that looks like this: <telerik:RadCodeBlock runat=server> <script type=text/javascript> function refresh()
I've been doing a little JavaScript (well, more like jQuery) for a while now
I doing a function in Javascript like the VisualBasic DateDiff. You give two dates
I have JavaScript that is doing activity periodically. When the user is not looking
I got this article for doing this but i found that this is not
After doing research I have discovered that Google Maps (on a webpage) will not
Is it the same if you load javascript to the page like this: <script
I totally understand that in order to learn javascript I need to know how
I'm doing javascript on a daily basis at the moment. I'm coming from an
A couple of months ago I was doing Javascript programming on the Facebook platform,

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.