Archive for tag: JavaScript

Clean string from non numerical chars

var a:
a = 'hndj76hew4ht6';
a = Number(a.replace(/[^0-9-.]/g, ""));

JQuery Document Ready

Code snippet showing how to use  jQuerys document ready.

<script type="text/javascript">
$(document).ready(function () {
alert('$(document).ready');
});
</script>

Enable Disable Objects

Small example showing how to enable/disable objects with the help of jQuery.

Disable:
$('#target').attr("disabled", true);

Enable:
$('#target').removeAttr("disabled");