-1

I am not sure why the below JS will not work on my Bootstrap page. I am getting this code straight from an online tutorial and I cannot seem to get it to work the way the instructor does. The console is telling me he issue is on the 3 line of the below script.

if (error != "")
                {
            $("#error").html('<div class="alert alert-danger"
            role="alert"><strong> There was error(s) in your form:</strong>'
            + error+ '</div>');
        
            }
});
4

1 回答 1

0

Rewrite your code without line breaks:

  if (error != "") {
    $("#error").html('<div class="alert alert-danger" role = "alert" > <strong> There was error(s) in your form:</strong>' + error + '</div>');
  }
});
于 2020-09-01T22:55:03.967 回答