My basic requirement is to set select option value using jquery and also want to get its value.
In my PHP code, I am creating options like
foreach ($option_value->values as $key => $opt_value) {
$variants_options .= '<option value="' . $variant_val . '">' . $opt_value . '</option>';
}
From js add this value as,
jQuery("#section-" + row_id + " .variant_detail_section.addFromApi .option1_options").html(value.variants_options[value.variants_name[0]]);
Now, I want to get value of selected
option1 = jQuery("#section-" + row_id + " .option1_options").find(":selected").val();
Here, I am getting half value
Getting: 'Pet Size Bed (40' instead 'Pet Size Bed (40" X 30")'
So, here the problem is How can I get double quotes string?
Is there any other way to set double quote string and get it from jquery or javascript?
UPDATE
Now I use html() for get text of selected option value.
Here my problem is I get html code of some special character like:
& <> instead &,<,>
So How can I get special characters instead of its htmlcode?
Can I use text() or it create any issue?