Just wondering if there is a way to get a HTML <button>
element to link to a location without wrapping it in an <a href...
tag?वहाँ एक रास्ता एक <a href ... tag?
Button currently looks like:
<button>Visit Page Now</button>
What I would prefer not to have:
<a href="link.html"><button>Visit Page Now</button></a>
The button is not being used within a form so <input type="button">
is not an option. I am just curious to see if there is a way to link this particular element without needing to wrap it in an <a href
tag.
Looking forward to hearing some options/opinions.
आप एक बटन क्यों चाहते हैं एक लिंक होना चाहते हैं? सिर्फ एक लिंक क्यों नहीं है? – robertc
@robertc, मैं आमतौर पर एक लिंक का उपयोग करता हूं लेकिन फिर
बटन तत्व का बिंदु एक स्क्रिप्ट फ़ंक्शन को ट्रिगर करना है, जैसे किसी फॉर्म पर डिलीवरी लागत को पुन: गणना करना या चयनित टेक्स्ट में बोल्ड स्वरूपण लागू करना, जो HTML द्वारा मूल रूप से समर्थित नहीं है। पृष्ठों के बीच नेविगेट करना कुछ ऐसा है जो HTML द्वारा समर्थित है, आपको ऐसा करने के लिए स्क्रिप्ट की आवश्यकता नहीं है, इसलिए आपको एक बटन की आवश्यकता नहीं है। – robertc