I'd like to know how I could capitalize the first letter of a row in JavaScript like in this PHP code :
<?php
$textParts = explode("
", $text);
foreach ($textParts as $key => $value) {
$textParts[$key] = ucfirst($value);
}
$text = implode("
", $textParts);
$text="namjaga da geureochi mwo narago dareugetni
ni mameul da gajyeodo naragabeorigo maneun
namjaga da geureochi mwo"
?>
<p>
<?php echo $text; ?>
</p>
In JS, I get the text into the "Roman" DIV after a tranformation :
<div id="Roman"> </div>
<script>
<?php include("../../tools/js/romantool.js"); ?>
function affichar() {
document.getElementById('Roman').innerHTML = latin_to_roman(
document.getElementById('Parol').innerHTML
);
}
affichar();
</script>
Does anyone know how I should proceed to do as in the previous PHP example ? Thank you !