Page attribute in <a>



  • Hello,

    I would like to use <a> in my home page to create a more customized layout. If I use Onsen components, there’s the attribute page to navigate. But is there a way to do something similar with <a>? I mean right now I have to use something like <a onclick=“document.getElementById (‘yourNavId’).pushPage (‘yourPage.html’)”> but I would prefer to use <a page=“yourPage.html”> .

    Thank you!



  • @etagrats You could always just use JS, such as:

    HTML (this could be anything really):

    <a id="myLink">Text</a>
    

    JS:

    document.getElementById('myLink').addEventListener('click',function(){
        document.getElementById(‘yourNavId’).pushPage (‘yourPage.html’);
     });
    

Log in to reply