Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 72388

How to replace '/' with ''?

$
0
0

I have the following code where I try and replace '/' with '' in an input element. But its not working. The '/' is not being replaced.

How can I make it work?

var playlistTitle = document.getElementById('PlaylistTitleInput').value;
$('#PlaylistTitleInput').text($('#PlaylistTitleInput').text().replace("/", ''));
console.log(document.getElementById('PlaylistTitleInput').value);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><div class="fullPageBackgroundForPlaylistAdding" id="fullPageBackgroundForPlaylistAdding" style="display: none;"><!-- style="display: none;" --><div class="addPlaylistElementsContainer"><h1 class="playlistLabel">Create new playlist</h1><div class="PlaylistTitleInput"><input id="PlaylistTitleInput" type="text" name="playlistTitle" placeholder="New Playlist" value=""></div><div class="cancel_CreateDiv"><button id="cancelBtnPress">Cancel</button><button id="createBtnPress">Create</button></div></div></div>

Viewing all articles
Browse latest Browse all 72388

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>