Search
 
SCRIPT & CODE EXAMPLE
 

HTML

svelte if

{#if x > 10}
	<p>{x} is greater than 10</p>
{:else if 5 > x}
	<p>{x} is less than 5</p>
{:else}
	<p>{x} is between 5 and 10</p>
{/if}
Comment

svelte if block

<script>
	let user = { loggedIn: false };
	let toggle = () => user.loggedIn = !user.loggedIn;
</script>

{#if user.loggedIn}
	<button on:click={toggle}>Log out</button>
{/if}

{#if !user.loggedIn}
	<button on:click={toggle}>Log in</button>
{/if}
Comment

PREVIOUS NEXT
Code Example
Html :: how to add bg html 
Html :: how to add image in html from a folder 
Html :: one image html 
Html :: select set selected value html 
Html :: cambiar src jquery 
Html :: html show and hide div 
Html :: typo3 headerdata 
Html :: how to stop marquee text in html when you hover over it 
Html :: html form using http 
Html :: onchange for contenteditable div 
Html :: %20 in html 
Html :: html injection 
Html :: autocapitalize html attribute 
Html :: ordered lists html 
Html :: html picture tag 
Html :: input type checkbox and hide checkbox 
Html :: etiqueta negritahtml 
Html :: javascript display with fade 
Html :: fork me github ribbon code html css 
Html :: icon for instagram in bootstrap 
Html :: bulma css lighter buttons 
Html :: html date min today 
Html :: html to markdown 
Html :: style font in html 
Html :: html code heavy right arrow 
Html :: style attribute in html 
Html :: Inlarge icons html 
Html :: how to hyperlink in html 
Html :: a attributes html 
Html :: how to make a svg of full width of a webpage html 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =