$("#btn1").click(function(){
$("#type1").html('<h2 id="heading">ab</h2>');
$("#type1").css({"background-color":"white","font-size":"15px","text-align":"center","padding-top":"50px;","background-image":"",});
$("")
$.each(menuobj.pizza.veg,function(value,index)
{
$("#heading").text(value+" "+ index);
});
答案 0 :(得分:-1)
var menu='{"pizza":{"veg":{"Name":"Veg-Pizza","Price":250},"nonveg":{"Name":"NonVeg-Pizza","price":350},"pizzamaina":{"Name":"Pizza-mania","Price":500}}}';
var menuobj=JSON.parse(menu);
$("#btn1").click(function(){
$("#type1").html('<h2 id="heading"></h2>');
$("#type1").css({"background-color":"white","font-size":"15px","text-align":"center","padding-top":"50px;","background-image":"",});
$("")
$.each(menuobj.pizza.veg,function(value,index)
{ `enter code here`
$("#heading").append(value+" "+ index);
});