0

I'm trying to change the text within my button and I just wondering is it possible for me to change it?

<div id="something">

<button class="someClass">This I wanna change</button>

</div>
1

2 Answers 2

0

Find class inside div and change your text like below.

$('#something').find('.someClass').text('I am changed');
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="something">
  <button class="someClass">This I wanna change</button>
</div>

Sign up to request clarification or add additional context in comments.

Comments

0

$(".someClass").text('New Text')
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="something">

<button class="someClass">This I wanna change</button>

</div>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.