Is it possible to set the equivalent of a src attribute of an img tag in CSS?

后端 未结 25 2634
借酒劲吻你
借酒劲吻你 2020-11-22 09:30

Is it possible to set the src attribute value in CSS? At present, what I am doing is:


25条回答
  •  爱一瞬间的悲伤
    2020-11-22 10:03

    Using CSS, it can't be done. But, if you are using JQuery, something like this will do the trick:

    $("img.myClass").attr("src", "http://somwhere");
    

提交回复
热议问题