is there a way I can make the content of the a webpage that utilizes jQuery/JavaScript viewable when JavaScript is disabled?
When I click on a h2 header info from the div tags will display using the jQuery
function. I have already included a noscript tag to display javaScript is disabled. Can I make the information from the header display when javaScript is turned off?
Thank you
<h1>CLICK ON AN ITEM TO VIEW INFORMATION (Scroll down to view)</h1>
<h2 data-type="pizza">Pizza</h2>
<h2 data-type="sandwich">Sandwiches</h2>
<h2 data-type="other">Other Items</h2>
<h2 data-type="beverage">Beverages</h2>
<div id="pizza" class="hidden">
<h3>PIZZA </h3>
<hr>
<br>
<p>
<strong>Classic:</strong>
Beef, Pepperoni, Onions & Mushrooms
(10")$11.40 (12") $14.55
</p>
<p>
<strong>Palace:</strong>
Sausage, Beef, Pepperoni, Onions & Mushrooms
(10") $11.40 (12") $14.55
</p>
<p>
<strong>Philly Steak:</strong>
Seasoned Steak with Onions, Green Peppers on our Special White Sauce   (10") $11.40 (12") $14.55
</p>
<p>
<strong>"B" Special:</strong>
Sausage, Salami, Canadian Bacon & Onions
(10") $11.40 (12") $14.55
</p>
<p>
<strong>Maverick:</strong>
Sausage, Beef, Canadian Bacon & Pepperoni
(10") $11.40 (12") $14.55
</p>
</div>
$(document).ready(function(){
$("h2").on('click', function(){
var id = $(this).attr("data-type");
$(".hidden").hide();
$("#"+id+"").toggle();
});
});
<noscript>
YOUR BROWSER DOES NOT SUPPORT JAVASCRIPT!
</noscript>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…