Use
document.getElementById('<%= txt_model_code.ClientID %>')
instead of
document.getElementById('txt_model_code')`
Also you can use onClientClick
instead of onClick
.
More Related Contents:
- How to do the same in JavaScript? [closed]
- How does this code call id with html?
- Password REGEX with min 6 chars, at least one letter and one number and may contain special characters
- Detecting Unsaved Changes
- Export to csv in jQuery
- ScriptManager.RegisterStartupScript code not working – why?
- What is the best way to download file from server
- How to call a C# function from JavaScript?
- jQuery returning “parsererror” for ajax request
- How to Detect Browser Window /Tab Close Event?
- TypeError: $(…).DataTable is not a function
- IE9 JavaScript error: SCRIPT5007: Unable to get value of the property ‘ui’: object is null or undefined
- Displaying a byte array as an image using JavaScript
- force browsers to get latest js and css files in asp.net application
- How do I give JavaScript variables data from ASP.NET variables?
- Multiple Windows using window.open()
- Function not defined error while using asp.net ajax
- jQuery DataTables server-side processing using ASP.NET WebForms
- Iframe.readyState does not work in chrome
- How to get asp.net client id at external javascript file
- What algorithm does Readability use for extracting text from URLs?
- Check if a popup window is closed
- Confirm postback OnClientClick button ASP.NET
- Submit form using AJAX in Asp.Net mvc 4
- Hook a javascript event to page load
- How to detect IE 11 with javascript in Asp.net
- focus on next tabindex of HTML element onEnter keypress by JQuery
- Change Enter from submission to Tab?
- Force server TextChanged event from javascript
- Add multiple window.onload events