Set paragraph text with javascript on page load

html, javascript, jquery, mobile

Solution

Please try `.text()` good read here: http://api.jquery.com/text/

demo http://jsfiddle.net/FyVzF/13/ or for your specific example using id please see here http://jsfiddle.net/FyVzF/14/

hope this helps!

code

$(document).ready(function() {

    $("p").text('test test Rambo');
});

HTML

<p> </p>

Problem

Basically all I want to do is set the text of a paragraph using JavaScript/jQuery on page load. This is for a simple Kendo UI app. Can anyone please give me a method of doing this? I know this is probably a noob question, but I'm semi inexperienced with JavaScript/jQuery. This is what I've already tried, but it doesn't seem to be working... ``` <script type=""> $(document).ready(function () { $("#mac001OEE").val("0%"); }); ``` This code has been placed in the head of the HTML page. Thanks :)

Original source