SRC in javascript and href in css
Hi, when linking css to html file, we use href as the attribute. Why then in javascript we use src? Cant we src in css also?
in your webpage, it tells the browser to insert the resource at the location. So now the browser has to fetch the js file and then loads it.","upvoteCount":2},{"@type":"Answer","text":"//hey Tan Fu Yu \nsrc (Source) attribute just embeds the resource in the current document at the location of the element's definition but css href only makes a link relationship between html and css like src they don't embed source on page","upvoteCount":2},{"@type":"Answer","text":"Shudarshan Rai 👑 hi raj thanks for the explanation. In that case why cant we use src for css too? It seems simpler and straightforwardly","upvoteCount":0},{"@type":"Answer","text":"Shudarshan Rai 👑 so why cant css embed a resource into html too?","upvoteCount":0}]} }
Hi, when linking css to html file, we use href as the attribute. Why then in javascript we use src? Cant we src in css also?