adobe-brackets

Open an HTML file in Adobe Brackets


I'm a very unexperienced programmer. I've been doing codeacademy javascript track but I found out that you need to put javascript in an HTML file? I want to make sure that I can write basic javascript before continuing on code academy so I downloaded brackets and when I tried to test my program with the live preview feature it said, "Open an HTML file or make sure there is an index.html file in your project in order to launch live preview. I typed this up very quickly so there are probably plenty errors but here is the code if that helps answer my question.

<!DOCTYPE html>
<html>
<body>

<h1> Daily Programmer Challenge 12/15/14 </h1>

<script type = "text/javascript">

var volume = prompt ("Enter the volume of the container that you wish to make");

var cube = math.pow(volume, 1/3);

window.document.write("The size of the container is '+cube+' width, '+cube+' high, and '+cube+' tall");

</script>
</body>
</html>

Solution

  • save this code that you pasted as a file called index.html and then try Bracket's live preview.