Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


<title>Weather API</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="">
  <script src=""></script>
  <script src=""></script>
  <script src="currentweather.js"></script>
<body background="" style="background-repeat:no-repeat;">
<div class="text-center container-fluid">
<h1 class="well well-lg" style="padding:20px;background-color:#46acdd;color:white;font-weight:bold;">Current Weather App</h1>
<h3 style="font-weight:bold;color:white;">Enter City Name<h3>
<span id="error"></span>
<input type="text" placeholder="Type city name" name="txt" id="city" style="padding:10px;"/>
<input type="button" id="submitWeather" class="btn btn-primary btn-lg" value="Search"/>
<div id="show" class="container-fluid" style="margin:auto;width:80%;"></div>
<!--<div class="well well-lg container-fluid text-center" style="padding:10px;margin-top:380px;background-color:#46acdd;color:white;font-weight:bold;">Copyright 2018 @BoopalanSundaramoorthy. 




		var city = $('#city').val();
		if(city != '')
				url:'' + city + "&units=metric" +
				type: "GET",
				dataType: "jsonp",
				success: function(data){
					var widget = show(data);
			$('#error').html("<div class='alert alert-danger text-center'><a href='#' class='close' data-dismiss='alert' aria-label='close'>&times;</a>Field Cannot be Empty</div>");
function show(data)
	return "<h2 style='font-size:30px;color:yellow;font-weight:bold;' class='text-center'>Current Weather for " + ", " + + ", " + + "</h2>" +		
		"<h4 style='color:white;'><strong>Longitude:</strong>: " + data.coord.lon + "</h4>" +
		"<h4 style='color:white;'><strong>Latitude:</strong>: " + + "</h4>" +	
		"<h4 style='color:white;'><strong>Weather</strong>: " +[0].main + "</h4>" +
		"<h4 style='color:white;'><strong>Description</strong>: <img src='"[0].icon+".png'>" +[0].description +"</h4>" +
		"<h4 style='color:white;'><strong>Temperature</strong>: " + data.main.temp +"&deg;C</h4>" +
		"<h4 style='color:white;'><strong>Pressure</strong>: " + data.main.pressure +" hPa</h4>" +
		"<h4 style='color:white;'><strong>Humidity</strong>: " + data.main.humidity +"%</h4>" +
		"<h4 style='color:white;'><strong>Minimum Temperature</strong>: " + data.main.temp_min +"&deg;C</h4>" +
		"<h4 style='color:white;'><strong>Maximum Temperature</strong>: " + data.main.temp_max +"&deg;C</h4>" +
		"<h4 style='color:white;'><strong>Wind Speed</strong>: " + data.wind.speed +"m/s</h4>" +
		"<h4 style='color:white;'><strong>Wind Direction</strong>: " + data.wind.deg +"&deg;C</h4>";