New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jquery-shift-heading-levels

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jquery-shift-heading-levels

JQuery plugin that shifts heading levels (h1 to h2, etc.).

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

jQuery plugin: Shift Heading Levels

Shifts heading levels up or down.

Use

<script src="jquery.min.js"></script>
<script src="jquery-shift-heading-levels.min.js"></script>
$( selector ).shiftHeadingLevels( shift_amt );

shift_amt can be positive or negative, and defaults to 1. Heading levels will not be shifted below 1 or above 6.

If something other than a heading is selected, the headings it contains will be shifted.

Attributes and contents are maintained.

Examples

// Changes all <h1> to <h2>.
$( 'h1' ).shiftHeadingLevels();

// Changes all <h2> to <h4>.
$( 'h2' ).shiftHeadingLevels( 2 );

// Changes all <h3> to <h2>.
$( 'h3' ).shiftHeadingLevels( -1 );

// Changes all <h4> to <h6>.
$( 'h4' ).shiftHeadingLevels( 100 );

// Changes <h5 id="this-is-an-h5"> to <h6 id="this-is-an-h5">.
$( '#this-is-an-h5' ).shiftHeadingLevels();

// Shifts all headings in <div id="this-is-a-div"> up by 1.
$( '#this-is-a-div' ).shiftHeadingLevels();

Keywords

FAQs

Package last updated on 15 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc