Skip to content

data-href #11

Open
Open
@martijn-dd

Description

@martijn-dd

I've add data-href values to my images. They are applied to the .mc-image div.
However I cannot bind a onclick event on the div.

I've added in the document ready:

$('.mc-image').click(function() {

console.log('working?'); // For testing
});

But no 'working?' in the firebug console.

Also not working:

$('.mc-image').each(function() {
$(this).attr('onclick', 'console.log("working?");');
});

The onclick attribute is added when I inspect the element with Firebug but still no action.

What is the way to add onclick to the div/image?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions