The call to start() should trigger the change
$(function () {
$('#ddlTo').on("change", function () {
$("#div1").html($(this).val());
})
start();
});
function start() {
$('#ddlTo').val("master");
}
The call to start() should trigger the change
$(function () {
$('#ddlTo').on("change", function () {
$("#div1").html($(this).val());
})
start();
});
function start() {
$('#ddlTo').val("master");
}
Your question isn't entirely clear, but my guess is you'd like to fire the change event when you initialise the value of the select.
This should do what you expect:
$('#ddlTo').val("master").change();
The change event only fires when the user initiates the change.
As alnorth29 pointed out, your question is not clear but maybe this is what you want:
$('#ddlTo').on("change", function() {
$("#div1").html($(this).val());
start();
});
Basically changing the select box back to "master" after displaying user selected value.
Edit: I misunderstood your question. As pointed out in the comments this behavior is not very logical.