I am in the process of developing a website that features multiple select options for creating sentences. My goal is to detect when users are changing these options to form specific sentences, such as changing "I", "Am", "Blue" to reflect the color blue. This functionality is just one option among many actions I would like to incorporate, such as "I am Big" or "I am rotated", each triggering a different response. Unfortunately, my current code snippet below is not functioning as intended because it cannot access the function phrase, which is defined elsewhere in the script. The code is designed to generate an initial phrase, preserve it, and allow it to evolve based on user input from the select dropdowns.
$('select').on('change', function() {
console.log(phrase);
if (phrase = "Is big"){
$(".white").css('font-size', '5em');
}
});
In this script, phrases are initially created, tokenized, and then manipulated based on user interactions with the select elements. The CSS styles included are specific to the font display and layout of the page elements.