I have a list with an option to delete them. However, no one can ever have zero and must have at least one. So I thought at the start of page load to make the first <a> to the delete be gone.
I tried this:
$(".delete-language").children(':first').attr('display', 'none');
and nothing.
Here is it:
<a id="1" name="40" href="#" class="delete-language"><img style="margin-left:7px;" src="images/icons/cross.png" alt="Delete" title="Remove" display="none"></a>
.attr('display', 'none')is a bit wrong asdisplayis not an HTML attribute.If you want to modify the css directly, use
.css('display', 'none')Better yet