neocities/views/tutorial/html/8.erb
2015-10-13 15:59:13 -07:00

39 lines
1.1 KiB
Text

<div class="comic" style="height: 600px; background-image: url(/img/tutorial/ch1pg8.png);">
<div class="dialogue">
Now add a link to one of your list items. If nested properly, it should look something like this:
<li><a href="http://yarn.com">Yarn</a></li>
</div>
</div>
<div class="welcome">
<h4>Tags so far</h4>
<p>Headings: <h1>Title of the page!</h1>
<h2>Less important title</h2></p>
<p>Paragraphs: <p>Hello!</p></p>
<p>Links: <a href="http://wikipedia.org">Click here!</a></p>
<p>Images: <img src="hello.png"></p>
<p>Lists</p>
</div>
<script>
function checkHomework(editor) {
var html = editor.val()
/* TODO: Make .+ ignore any spaces or newlines or whatever. </a> lol </p> is fine too. */
var match = '<html>.+<body>.+<ul>.+<li><a.+href=".+">.+</a></li>.+</ul>.+</body>.+</html>'
var re = new XRegExp(match, 'gis')
if(html.match(re) === null) {
alert("That's not right! Try again.")
} else {
alert('Great, you did it!')
sessionStorage.setItem('tutorialHtml', html)
window.location.href = '/tutorial/html/9'
}
}
</script>