selected attribute in option tag : i have a dropdown that's populated through a loop. the selected attribute should be added <%if o.getNextPage()%> is equal to i. 

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

    <select id="dropDown" onchange="display(this.value)">

    var start = 1;
    	var end = noOfPages;
    	var options = "";
    	for (var i = start; i <= end; i++) {
    		options += "<option>" + i + "</option>";
    	}

    	document.getElementById("dropDown").innerHTML = options;

<!-- end snippet -->

 