Skip to content

Instantly share code, notes, and snippets.

@pokk
Last active March 31, 2017 07:51
Show Gist options
  • Save pokk/3d896559d2e3e6220cb824d03fa602f5 to your computer and use it in GitHub Desktop.
Save pokk/3d896559d2e3e6220cb824d03fa602f5 to your computer and use it in GitHub Desktop.
Change the tag of select option text.

Introduction

Change the tag of select option text.

Html

<select id="select_page">
    <option value="schedule">schedule</option>
    <option value="message">message (12)</option>
    <option value="payment">payment</option>
</select>

Javascript

$('#select_page').find('option[value="message"]').text("message (" + 1 + ")");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment