Search code examples
htmlrubymine

What does !src means in html


When I use autocompletion in my IDE it fills like this

  <script !src=""></script>

Even I removed that bang ! it simply works. So what does it means? Does it have any purpose I should be beware of?


Solution

  • The src or Source attribute is used to specify the URL (path) of the file or link. In the <script !src=""></script> you need to specify the JavaScript file to load. It will work without the ! mark.

    It is also used with <img>, <audio> and <video> HTML tags.

    Example:

    <script src="scrip.js"></script>
    

    Specifically to your question, HTML does not have !src but only src.