Search code examples
htmlformshref

'href=' not working in project


href="link here" doesn't work for me. i.e clicking the updates button doesn't load its page. Here's that part of the code:

<div class="st-container">
    <input type="radio" name="radio-set" checked="checked" id="st-control-1"/>
    <a href="home.html">Home</a>
    <input type="radio" name="radio-set" id="st-control-2" />
    <a href="../update/update.html">Updates</a>
    <input type="radio" name="radio-set" id="st-control-3"/>
    <a href="#">Gallery</a>
    <input type="radio" name="radio-set" id="st-control-4"/>
    <a href="#">Ideals</a>
    <input type="radio" name="radio-set" id="st-control-5"/>
    <a href="#">Support</a>
</div>

Solution

  • To clarify: The issue here does not appear to be incorrect paths or the non-existence of files.

    The OP wants to use radio buttons for navigation, so that clicking an <input> will navigate to a different URI.

    This can be done with javascript using an onclick handler.
    A few variations are detailed here: https://stackoverflow.com/questions/13789120/how-do-i-create-a-button-href

    <input type="button" value="Page" onclick="location.href='http://example.com';">
    

    Be advised that usability can be adversely affected by using form elements for navigation. One example: if a user has javascript disabled in his/her browser, the navigation will fail.