Created
September 30, 2018 14:17
-
-
Save anomepani/989aa8cfdf5aabc9e0dfb203c8058f98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cheerio = require('cheerio') | |
const $ = cheerio.load('<h2 class="title">Hello world</h2>') | |
$('h2.title').text('Hello there!') | |
$('h2').addClass('welcome') | |
$.html() | |
//=> <h2 class="title welcome">Hello there!</h2> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment