lundi 29 avril 2019

Need to make program know what values are selected and spit out a specfic object based on the seleted values

My friend and I are setting up working on a project and are stuck. We want to make a specific object spit out based on selected values but we're stuck to the point where no matter what we select the same object always gets spat out. How do we make it so it spits out the object we want it to?

This is for a project for a Computer Science class. This is our first experience with anything outside of Applab so we are very new to actual code.

$('p#bread).hide();
getSelectedIngredients = function (){
  var selectedValues = $('#ingredients').val(){
  var cookingIngredients=["1","2","3","4","5"]
  var bread=cookingIngredients.includes("2","3");

  if (bread=true){
     $('p#bread').show();
  }else{
     $('p#bread').hide();
}

As I said before, we want a specific object to spit out based on selected items.

Aucun commentaire:

Enregistrer un commentaire