简体   繁体   中英

Add telerik RadNumericTextBox to <td> innerHTML using Javascript

I want to add telerik RadNumericTextBox to innerHTML using javascript or jquery. How can i achieve this?

If you mean the RadNumericTextBox specified here , then you are looking for a server solution that has nothing to do with javascript.

innerHTML is a property of a DOM element that can't exist until firstly a DOM and secondly an element within it exists. So if you are looking for a server-side solution it has nothing to do with innerHTML or javascript (at least in regard to adding suitable markup at the server in ASP.NET).

If you are looking for equivalent functionality to be applied on the client, you can validate input at some convenient time (that is, convenient for the user) which is likely when a form is posted or when the user leaves the field in question (which will typically dispatch a blur event and perhaps a change event if the value changed).

You can also use the HTML5 input@type=number, however that will only work in browsers that support it (a good percentage don't).

A listener that validates that the value of a form control (probably an input in this case) is quite simple to write and attach to the element if that is what you want. In any case, innerHTML is unlikely to be involved in a suitable client-side solution.

What are you actually trying to do?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM