Jari Ullah
Jari Ullah

Reputation: 1

Button onclick replace with DIV

I want to replace button with a DIV in template design of my blog. The code for button is

<button onClick="menu1.toggle();" class="sideviewtoggle fa fa-bars"></button>

And jquery script I am using for it is

jQuery(function(){ // on DOM load
    menu1 = new sidetogglemenu({  // initialize first menu example
        id: 'togglemenu1',
        marginoffset: 10,
        downarrowsrc: 'toggledown.png'
    })

})

It opens a siedbar toggle menu on click. I don't want to use <button> tag for this purpose, instead I want to use a <div> tag so that the functions onclick instead of button. I think that it can be done by using a small code of Javascript but as I am new to Javascript so unable to do it myself? What should I do? Here is the url to template. http://testing-prov4.blogspot.com

Upvotes: 0

Views: 721

Answers (1)

Mike
Mike

Reputation: 1316

It sounds like you would like to use a div element to trigger the slideout menu instead of a button element. This can be easily accomplished. Your current code reads:

<button class='sideviewtoggle fa fa-bars' onClick='menu1.toggle();'></button>

You can replace this with:

<div class='sideviewtoggle fa fa-bars' onClick='menu1.toggle();'></div>

without changing any functionality. (CSS changes just a bit)

Upvotes: 1

Related Questions