javascript - Reset style properties of an HTML element to stylesheet-defined defaults? -


सीएसएस कोड:

  p.myparagraph {color: yellow; }  

मान लें कि मैंने & lt; p & gt; तत्वों का रंग बदल दिया है जो कि myparagraph वर्ग को लाल रंग में उपयोग करते हैं I क्या सीएसएस-परिभाषित डिफॉल्ट के लिए इस वर्ग (रंग तक सीमित नहीं) का उपयोग कर पैराग्राफ के सभी स्टाइल गुणों को रीसेट करने का एक तरीका है?

निम्न कोड संशोधित होगा और नाम सीमा के साथ वर्ग

  & lt; script type =" text / javascript "& gt; $ (दस्तावेज़) .ready (function () {$ ("borderParra")। फ़ोकस (फ़ंक्शन () {$ (this) .addClass ("blueborder"); $ (यह)। चयन ();}); $ (".borderParra")। धुंधला (कार्य () {$ (यह) .removeClass ("blueborder");});}); & Lt; / स्क्रिप्ट & gt;  

जहां शैलियों हैं

  .yellowBorder (सीमा: 1 पीएक्स ठोस # एफसी 3;) .ब्लूबॉर्डर {सीमा: 1 पीएक्स ठोस # 014165;}  

Comments

Popular posts from this blog

iphone - How do I make a UIPickerView in a UIActionSheet -

java - Is there an object like a "Set" that can contain only unique string values, but also contain a count on the number of occurrences of the string value? -