Sandbox
Feel free to play around with the example below to see how the web page reacts to your code changes in a consequence-free environment. You won't break or overwrite anything so go for gold.
This project introduces how Svelte can help improve how your HTML and JavaScript interact.
When you write Svelte, you write your code into a .svelte
file, which contains JavaScript, CSS, and HTML all in one place.
Svelt's main advantage that we'll be taking advantage of is that it makes it very easy to get information to and from the page.
Compare the jQuery version of Hello World with the Svelte version and see how much less code it takes and how natural it feels to follow it.
<h3>Hello <span id="txtName"></span>!</h3>
$('#txtName').text('world')
<script>
let name = 'world'
</script>
<h3>Hello {name}!</h3>
npm run dev
.https://localhost:3000
.Feel free to play around with the example below to see how the web app reacts to your changes in a consequence-free environment.
Feel free to play around with the example below to see how the web page reacts to your code changes in a consequence-free environment. You won't break or overwrite anything so go for gold.