There are several problems with this code, first off that you are mixing jQuery with JavaScript—the context I am talking about here. For example, see here,
$('#channelType').on('change', function() {
if (this.value == '1')
{
this
refers to a JavaScript object, not a jQuery one, to refer to that you need to use
$(this)
object. So I can solve this for you to work in jQuery, provided everything else is fine.
$(document).ready(function(){
$('#channelType').on('change', function() {
if ($(this).val() == '1')
{
$("#internal").show();
}
else
{
$("#internal").hide();
}
});
});
This should work as jQuery, in case you wanted to make it work. If not, then you need to change a lot of things, starting with the HTML, perhaps your element is a select element, thus that goes like,
<select id="channelType" onchange="channelChanged();">
<!--
</select>
Then, somewhere in the JavaScript, you would write the following function to handle the change of value in that element,
function channelChanged() {
var channelType = document.getElementById("channelType");
var internalObject = document.getElementById("internal");
if(channelType.value == '1') {
internalObject.style.display = 'block';
} else {
internalObject.style.display = 'none';
}
}
But again, is this what you want to use? :-)
Read more about onchange event,
onchange - Mozilla | MDN[
^]