Change link by checking a radio button

2798 views javascript
1

I have to modify <meta property="og:url" content="http://a42de5e.contato.site/agradecimento"> <- when somenone checks 'yes' in a radio button, is there any way I could do it using JavaScript?

<div class="form-group">

  <h4 class="control-label" data-selector="h4">Would you support us?</h4>

  <label class="radio-inline"><input type="radio" name="Yes" value="Yes">Sim</label>
  <label class="radio-inline"><input type="radio" name="No" value="No ">Não</label>

</div>

I tried something using "getElementByID" but I'm not sure if it's possible because it's a meta tag

answered question

1 Answer

0

Not sure if you needed a vanilla javascript answer but in jquery you could probably do something like this $("meta[property='og\\:url']").attr("content", "your desired string"); to change the content dynamically

posted this

Have an answer?

JD

Please login first before posting an answer.