I think it should be:
$("a img[data-name='myCar']").css('left');
pritaeas
Posting Prodigy
9,265 posts since Jul 2006
Reputation Points: 1,173
Solved Threads: 1,456
Skill Endorsements: 86
This worked for me:
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
<a href="#">
<img src="hacker.png" data-name="myCar" />
</a>
<a href="#">
<img src="hacker.png" data-name="yourCar" />
</a>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$("a img[data-name='myCar']").hide();
// this works too:
$allImages = $("a img");
$.each($allImages, function () { $("[data-name='yourCar']").hide() });
});
</script>
</body>
</html>
pritaeas
Posting Prodigy
9,265 posts since Jul 2006
Reputation Points: 1,173
Solved Threads: 1,456
Skill Endorsements: 86
Question Answered as of 5 Months Ago by
pritaeas
and
jstfsklh211