Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

alpinejs tabs

<div x-data="{ tab: 'foo' }">
    <button :class="{ 'active': tab === 'foo' }" @click="tab = 'foo'">Foo</button>
    <button :class="{ 'active': tab === 'bar' }" @click="tab = 'bar'">Bar</button>

    <div x-show="tab === 'foo'">Tab Foo</div>
    <div x-show="tab === 'bar'">Tab Bar</div>
</div>
Comment

PREVIOUS NEXT
Code Example
Javascript :: js stop form submit 
Javascript :: how to submit using checkbox 
Javascript :: window.href 
Javascript :: e vs backwards e math 
Javascript :: random index js 
Javascript :: angular ng serve with custom port 
Javascript :: how to get the value of radio button in jquery 
Javascript :: update node-modules 
Javascript :: how prevent copy paste input react 
Javascript :: cryptojs md5 get string 
Javascript :: format percentage javacsript 
Javascript :: javascript base64 encode 
Javascript :: validador de cep javascript 
Javascript :: jquery last character in string 
Javascript :: after load page jquery 
Javascript :: javascript string into substrings of length 
Javascript :: get params js 
Javascript :: vue.js use scss in balise style 
Javascript :: find last prisma 
Javascript :: split array into chunks 
Javascript :: jquery scroll into view 
Javascript :: choose jsp 
Javascript :: confirm message in jquery 
Javascript :: js get home url 
Javascript :: how to scroll down to the bottom of a div using javascript 
Javascript :: get only numbers regex javascript 
Javascript :: set onclick javascript 
Javascript :: javascript sort array of objects by date 
Javascript :: how to check if enter is pressed javascript 
Javascript :: mongoose timestamps 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =