Below the example to trim last two characters.
<script>
var content_string = 'RAMP IT';
var content_string_name = content_string.slice(0, -2); //=> slice(0, -N) - update N based on your need.
alert(content_string_name);
</script>
Below the example to trim last two characters.
<script>
var content_string = 'RAMP IT';
var content_string_name = content_string.slice(0, -2); //=> slice(0, -N) - update N based on your need.
alert(content_string_name);
</script>
Use the below code to get the particular CSS style property value. Within the below example, its get and displaying the “background-color” value as “blue”.
<div style="background-color:blue;"></div>
<script>
$( "div" ).click(function() {
var color = $( this ).css( "background-color" );
alert(color); // Use this value
});
</script>
<script>
function myFunction(a, b) {
return a * b;
}
document.getElementById("demo").innerHTML = myFunction(4, 3);
</script>
<script>
if(navigator.userAgent.match(/Android/i)
|| navigator.userAgent.match(/webOS/i)
|| navigator.userAgent.match(/iPhone/i)
|| navigator.userAgent.match(/iPod/i)
|| navigator.userAgent.match(/BlackBerry/i)
|| navigator.userAgent.match(/Windows Phone/i)) {
document.write('<meta name="viewport" content="width=400');
}
</script>