Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


                <!DOCTYPE html>
<html lang="ja">
    <meta charset="UTF-8">
    <style type="text/css">
            color : #000000;
            margin-right: auto;
            margin-left : auto;
            font-weight: 900;
    <input style="width: 75%;" type="text" id="check" placeholder="確認したい文字列">
    <input type="button" onClick="check()" value="確認する">
    <span id='check_word''></span>

    <span style="color:red;" id='complete'></span>
    <div id='check_result'></div>
<script type="text/javascript">
    function check(){
        var word = document.getElementById("check").value;

        if(word != ''){
            document.getElementById('check_word').innerHTML = word;

            const converted = [];    // 文字を格納する配列を用意する。
            for (let i = 0, len = word.length; i < len; i++) {
            const char = word.charAt(i);    // インデックスの位置の一文字を取得する。
            converted.push(char);           //  要素を追加する。
            let reversed = '';    // 反転された文字を入れる変数を用意する。
            for (let i = 0, len = converted.length; i < len; i++) {
            const popped = converted.pop();    // 配列の末尾から1つ取り出す。
            reversed += popped;                // 文字を繋げる。

            document.getElementById('complete').innerHTML = reversed;

            if(word == reversed){
                var check_result = '回文です';
            } else {
                var check_result = '回文ではないです';
            document.getElementById('check_result').innerHTML = check_result;