title: Replacing text with javascript?
body: <p>After much trial an error and some progress I still can't mange to change every instance of <code>,-</code> with <code>kr</code> on my website.
  I'm very much a beginner at JS and have pieced together the following code from several sources. Is the code the problem or something else?</p>
  
  <pre><code>function skrivkr() {
  var skrivkr = $('div').text().replace(/\,-/g, 'kr');
  $('p').html(skrivkr);
  }
  window.onload = skrivkr();
  </code></pre>
  
  <p><strong>Update:</strong>
  Thanks for the replies. The site loads jquery 1.10.7.
  @Niet the Dark Absol: No, I don't want to put anything in p elements. How do I remove that part? I just want to find all <code>,-</code> and simply replace with kr without changing any formatting. </p>
  
  <p><strong>Update</strong>
  OK! Progress, kind of. The ENTIRE content of every <code>&lt;strong&gt;</code> and <code>&lt;dd&gt;</code> now changes to (0), instead of kr. With the odd exception of those tags including ,-.  I haven't designed the site myself.</p>
  
  <p>If it helps, one of the ,- appears in the following markup:</p>
  
  <pre><code>&lt;a href="xxxx" rel="nofollow"&gt;
  &lt;span class="amount"&gt;1&lt;/span&gt;
  &lt;span class="photo"&gt;
  &lt;img src="xxxx" alt="product name" width="62" height="42"&gt;
  &lt;/span&gt;
  &lt;span class="description"&gt;
  Prtoduct name
  &lt;strong&gt;4444,-&lt;/strong&gt;
  &lt;/span&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p>And the lastest script I'm applying is:</p>
  
  <pre><code>$(document).ready(function() {
  $('strong, dd').html($('strong, dd').html().replace(/,-/g, 'kr'));
  });
  </code></pre>