Skip to content

Commit

Permalink
clear button moved
Browse files Browse the repository at this point in the history
  • Loading branch information
nikamaish committed Mar 4, 2024
1 parent 24bfab7 commit 15f118b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<style>
body {
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-columns: 0.6fr 1fr 0.6fr;
height: 100vh;
margin: 0;
font-family: 'Arial', sans-serif;
Expand Down Expand Up @@ -46,10 +46,11 @@
}
#editor textarea {
padding-top: 20px;
/* line-height: 1.5em; */
}
#lineNumbers {
box-sizing: border-box;
padding: 20px;
padding: 20px 20px 20px 0;
background-color: #f4f4f4;
border-right: 1px solid #ddd;
font-family: monospace;
Expand Down Expand Up @@ -125,6 +126,7 @@ <h2>Recreate Below Shape</h2>
</div>

<div id="output">
<button id="clear">Clear</button>
<iframe id="outputFrame" frameborder="0"></iframe>
</div>

Expand Down Expand Up @@ -169,6 +171,15 @@ <h2>Recreate Below Shape</h2>

// Initial line numbers update
updateVisibleLineNumbers();


let clear = document.getElementById('clear');
clear.addEventListener('click', function(){
document.getElementById('editor').querySelector('textarea').value = '';
updateOutput();
// why updateOutput is called here?

})
</script>
</body>

Expand Down

0 comments on commit 15f118b

Please sign in to comment.