Consider the following code snippet:

<style>
    img {
        border: 1px solid #ff00ff;
    }
</style>
<img src="someImage.jpg" alt="image"/>
Ho can you remove a border of the image element using a jQuery?

Fix it! The answer $("#someImg").css("border","none") is incorrect and does not work ! It is a syntax for choosing element by id. The correct answer will be: $(function() { $("[src='someImage.jpg']").css("border","none"); }); Reference links: https://api.jquery.com/id-selector/ https://api.jquery.com/attribute-equals-selector/ No matter single or double quote sign is used.

2017 Jun 8, 7:27:23 AM

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback