How do I use jQuery to change the value of a css selector value? -


यह मेरे पास है:

  & lt; div class = "class1 class2" शैली = "पृष्ठभूमि-छवि: url (https: //background-image.jpg);" & gt; & lt; / div & gt;  

मैं दो वर्गों को लक्षित करने के लिए JQuery का उपयोग करना चाहता हूं और पृष्ठभूमि छवि का मूल्य https से http तक परिवर्तित करना चाहता हूं। मैं उसे कैसे कर सकता हूँ?

मुझे पता है कि मैं मूल्य को जोड़ने के लिए .css कर सकता हूँ, लेकिन मुझे यकीन नहीं है कि मैं केवल http मूल्य कैसे बदल सकता हूँ। क्या यह संभव है?

इसे आज़माएं:

  var bg = $ ( '.class1.class2') सीएसएस ( 'पृष्ठभूमि छवि')। $ ( '। Class1.class2') सीएसएस ( 'पृष्ठभूमि छवि', bg.replace ( 'https', 'http'))।  


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -