javascript - How to strip string from a string and push into array? -
i running following:
var countries = []; $("#usp-custom-3 option").each(function() { var single = $(this).text(); if($(single == "united states of america")) { $(this).text() == "united states"; } countries.push(single); console.log(single); });
basically trying convert united states of america
united states
before push array rest of countries have list of countries in select option
.
var countries = []; $("#usp-custom-3 option").each(function() { var single = $(this).text(); if(single == "united states of america") { single= "united states"; } countries.push(single); console.log(single); });
Comments
Post a Comment