Скрытие и отображение списка элементов JavaScript / HTML

#javascript #html

#javascript #HTML

Вопрос:

Я заканчиваю создание файла JavaScript, который скрывает / не показывает элементы с веб-страницы. Способ, которым это должно работать, заключается в том, что когда вы выбираете персонажа из выпадающего списка, он фильтрует сценарий игры и показывает ТОЛЬКО диалог этого персонажа без дополнительных пробелов, которые создаются при использовании elem.style.opacity = 0.0; .

Способ, которым я воспользовался для этого, заключается в изменении непрозрачности всех строк, которые не являются диалогом выбранного персонажа. Вместо этого мне нужно было бы удалить эти строки. Мои ограничения заключаются в том, что я не могу использовать .remove(), jQuery, и я не могу каким-либо образом отредактировать HTML-файл.

В настоящее время это моя главная проблема. Но также опция по умолчанию «Показывать все строки символов» не работает после того, как вы отфильтровали результаты один раз для некоторого символа. Если кто-нибудь может указать мне правильное направление о том, как сбросить отфильтрованные результаты или отобразить все строки при нажатии на эту опцию, я был бы признателен. Я уверен, что смогу разобраться в этом самостоятельно, моя главная задача — фильтровать строки символов.

HTML:

 <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>

<title>The Tempest, Act V, Scene 1</title>
<meta charset="UTF-8" />
<link href="plays.css" rel="stylesheet" type="text/css" />
<script src="scene.js" type="text/javascript"></script>
</head>

<body>
<div id="linklist">
   <img src="plays_out.jpg"  alt="The Plays" />
   <img src="son_out.jpg"  alt="The Sonnets" />
   <img src="bio_out.jpg" alt="Biography" />
   <img src="globe_out.jpg" alt="The Globe" />
   <img src="strat_out.jpg" alt="Stratford" />
</div>
<div id="title"><img src="tempest.jpg" alt="The Tempest" /></div>
<div id="actList"><table><tr>
   <td>ACT I</td><td>ACT II</td><td>ACT III</td>
   <td>ACT IV</td><td>ACT V</td>
</tr></table></div>

<div id="characterList"></div>


<div id="sceneIntro">
<h2>Lines from Act V, Scene 1</h2>
</div>

<div id="scene">
<h3>PROSPERO</h3>
<blockquote><div><i>Enter PROSPERO in his magic robes, and ARIEL</i></div></blockquote>
<blockquote><div>Now does my project gather to a head:<br />
My charms crack not; my spirits obey; and time<br />
Goes upright with his carriage. How's the day?
</div></blockquote>

<h3>ARIEL</h3>
<blockquote><div>On the sixth hour; at which time, my lord,<br />
You said our work should cease.
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>I did say so,<br />
When first I raised the tempest. Say, my spirit,<br/>
How fares the king and's followers?
</div></blockquote>

<h3>ARIEL</h3>
<blockquote><div>Confined together<br />
In the same fashion as you gave in charge,<br />
Just as you left them; all prisoners, sir,<br />
In the line-grove which weather-fends your cell;<br />
They cannot budge till your release. The king,<br />
His brother and yours, abide all three distracted<br />
And the remainder mourning over them,<br />
Brimful of sorrow and dismay; but chiefly<br />
Him that you term'd, sir, 'The good old lord Gonzalo;<br />
His tears run down his beard, like winter's drops<br />
From eaves of reeds. Your charm so strongly works 'em<br />
That if you now beheld them, your affections<br />
Would become tender.
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>Dost thou think so, spirit?
</div></blockquote>

<h3>ARIEL</h3>
<blockquote><div>Mine would, sir, were I human.
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>And mine shall.<br />
Hast thou, which art but air, a touch, a feeling<br />
Of their afflictions, and shall not myself,<br />
One of their kind, that relish all as sharply,<br />
Passion as they, be kindlier moved than thou art?<br />
Though with their high wrongs I am struck to the quick,<br />
Yet with my nobler reason 'gaitist my fury<br />
Do I take part: the rarer action is<br />
In virtue than in vengeance: they being penitent,<br />
The sole drift of my purpose doth extend<br />
Not a frown further. Go release them, Ariel:<br />
My charms I'll break, their senses I'll restore,<br />
And they shall be themselves.
</div></blockquote>

<h3>ARIEL</h3>
<blockquote><div>I'll fetch them, sir.</div></blockquote>

<blockquote><div><i>Exit</i></div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>Ye elves of hills, brooks, standing lakes and groves,<br />
And ye that on the sands with printless foot<br />
Do chase the ebbing Neptune and do fly him<br />
When he comes back; you demi-puppets that<br />
By moonshine do the green sour ringlets make,<br />
Whereof the ewe not bites, and you whose pastime<br />
Is to make midnight mushrooms, that rejoice<br />
To hear the solemn curfew; by whose aid,<br />
Weak masters though ye be, I have bedimm'd<br />
The noontide sun, call'd forth the mutinous winds,<br />
And 'twixt the green sea and the azured vault<br />
Set roaring war: to the dread rattling thunder<br />
Have I given fire and rifted Jove's stout oak<br />
With his own bo< the strong-based promontory<br />
Have I made shake and by the spurs pluck'd up<br />
The pine and cedar: graves at my command<br />
Have waked their sleepers, oped, and let 'em forth<br />
By my so potent art. But this rough magic<br />
I here abjure, and, when I have required<br />
Some heavenly music, which even now I do,<br />
To work mine end upon their senses that<br />
This airy charm is for, I'll break my staff,<br />
Bury it certain fathoms in the earth,<br />
And deeper than did ever plummet sound<br />
I'll drown my book.
</div></blockquote>

<blockquote><div><i>Solemn music</i></div></blockquote>

<blockquote><div><i>Re-enter ARIEL before: then ALONSO, with a frantic gesture, attended by GONZALO; SEBASTIAN and ANTONIO in like manner, attended by ADRIAN and FRANCISCO they all enter the circle which PROSPERO had made, and there stand charmed; which PROSPERO observes.</i></div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>A solemn air and the best comforter<br />
To an unsettled fancy cure thy brains,<br />
Now useless, boil'd within thy skull! There stand,<br />
For you are spell-stopp'd.<br />
Holy Gonzalo, honourable man,<br />
Mine eyes, even sociable to the show of thine,<br />
Fall fellowly drops. The charm dissolves apace,<br />
And as the morning steals upon the night,<br />
Melting the darkness, so their rising senses<br />
Begin to chase the ignorant fumes that mantle<br />
Their clearer reason. O good Gonzalo,<br />
My true preserver, and a loyal sir<br />
To him you follow'st! I will pay thy graces<br />
Home both in word and deed. Most cruelly<br />
Didst thou, Alonso, use me and my daughter:<br />
Thy brother was a furtherer in the act.<br />
Thou art pinch'd fort now, Sebastian. Flesh and blood,<br />
You, brother mine, that entertain'd ambition,<br />
Expell'd remorse and nature; who, with Sebastian,<br />
Whose inward pinches therefore are most strong,<br />
Would here have kill'd your king; I do forgive thee,<br />
Unnatural though thou art. Their understanding<br />
Begins to swell, and the approaching tide<br />
Will shortly fill the reasonable shore<br />
That now lies foul and muddy. Not one of them<br />
That yet looks on me, or would know me Ariel,<br />
Fetch me the hat and rapier in my cell:<br />
I will discase me, and myself present<br />
As I was sometime Milan: quickly, spirit;<br />
Thou shalt ere long be free.
</div></blockquote>

<blockquote><div><i>ARIEL sings and helps to attire him</i></div></blockquote>

<h3>ARIEL</h3>
<blockquote><div>Where the bee sucks. there suck I:<br />
In a cowslip's bell I lie;<br />
There I couch when owls do cry.<br />
On the bat's back I do fly<br />
After summer merrily.<br />
Merrily, merrily shall I live now<br />
Under the blossom that hangs on the bough.
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>Why, that's my dainty Ariel! I shall miss thee:<br />
But yet thou shalt have freedom: so, so, so.<br />
To the king's ship, invisible as thou art:<br />
There shalt thou find the mariners asleep<br />
Under the hatches; the master and the BOATSWAIN<br />
Being awake, enforce them to this place,<br />
And presently, I prithee.
</div></blockquote>

<h3>ARIEL</h3>
<blockquote><div>I drink the air before me, and return<br />
Or ere your pulse twice beat.
</div></blockquote>

<blockquote><div><i>Exit</i></div></blockquote>

<h3>GONZALO</h3>
<blockquote><div>All torment, trouble, wonder and amazement<br />
Inhabits here: some heavenly power guide us<br />
Out of this fearful country!
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>Behold, sir king,<br />
The wronged Duke of Milan, Prospero:<br />
For more assurance that a living prince<br />
Does now speak to thee, I embrace thy body;<br />
And to thee and thy company I bid<br />
A hearty welcome.
</div></blockquote>

<h3>ALONSO</h3>
<blockquote><div>Whether thou best he or no,<br />
Or some enchanted trifle to abuse me,<br />
As late I have been, I not know: thy pulse<br />
Beats as of flesh and blood; and, since I saw thee,<br />
The affliction of my mind amends, with which,<br />
I fear, a madness held me: this must crave,<br />
An if this be at all, a most strange story.<br />
Thy dukedom I resign and do entreat<br />
Thou pardon me my wrongs. But how should Prospero<br />
Be living and be here?
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>First, noble friend,<br />
Let me embrace thine age, whose honour cannot<br />
Be measured or confined.
</div></blockquote>

<h3>GONZALO</h3>
<blockquote><div>Whether this be<br />
Or be not, I'll not swear.
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>You do yet taste<br />
Some subtilties o' the isle, that will not let you<br />
Believe things certain. Welcome, my friends all!<br />
But you, my brace of lords, were I so minded,<br />
I here could pluck his highness' frown upon you<br />
And justify you traitors: at this time<br />
I will tell no tales.
</div></blockquote>

<h3>SEBASTIAN</h3>
<blockquote><div>[Aside] The devil speaks in him.
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>No.<br />
For you, most wicked sir, whom to call brother<br />
Would even infect my mouth, I do forgive<br />
Thy rankest fau< all of them; and require<br />
My dukedom of thee, which perforce, I know,<br />
Thou must restore.
</div></blockquote>

<h3>ALONSO</h3>
<blockquote><div>If thou be'st Prospero,<br />
Give us particulars of thy preservation;<br />
How thou hast met us here, who three hours since<br />
Were wreck'd upon this shore; where I have lost--<br />
How sharp the point of this remembrance is!--<br />
My dear son Ferdinand.
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>I am woe for't, sir.
</div></blockquote>

<h3>ALONSO</h3>
<blockquote><div>Irreparable is the loss, and patience<br />
Says it is past her cure.
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>I rather think<br />
You have not sought her help, of whose soft grace<br />
For the like loss I have her sovereign aid<br />
And rest myself content.
</div></blockquote>

<h3>ALONSO</h3>
<blockquote><div>You the like loss!
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>As great to me as late; and, supportable<br />
To make the dear loss, have I means much weaker<br />
Than you may call to comfort you, for I<br />
Have lost my daughter.
</div></blockquote>

<h3>ALONSO</h3>
<blockquote><div>A daughter?<br />
O heavens, that they were living both in Naples,<br />
The king and queen there! that they were, I wish<br />
Myself were mudded in that oozy bed<br />
Where my son lies. When did you lose your daughter?
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>In this last tempest. I perceive these lords<br />
At this encounter do so much admire<br />
That they devour their reason and scarce think<br />
Their eyes do offices of truth, their words<br />
Are natural breath: but, howsoe'er you have<br />
Been justled from your senses, know for certain<br />
That I am Prospero and that very duke<br />
Which was thrust forth of Milan, who most strangely<br />
Upon this shore, where you were wreck'd, was landed,<br />
To be the lord on't. No more yet of this;<br />
For 'tis a chronicle of day by day,<br />
Not a relation for a breakfast nor<br />
Befitting this first meeting. Welcome, sir;<br />
This cell's my court: here have I few attendants<br />
And subjects none abroad: pray you, look in.<br />
My dukedom since you have given me again,<br />
I will requite you with as good a thing;<br />
At least bring forth a wonder, to content ye<br />
As much as me my dukedom.<br /><br />
<i>Here PROSPERO discovers FERDINAND and MIRANDA playing at chess</i></div></blockquote>

<h3>MIRANDA</h3>
<blockquote><div>Sweet lord, you play me false.
</div></blockquote>

<h3>FERDINAND</h3>
<blockquote><div>No, my dear'st love,<br />
I would not for the world.
</div></blockquote>

<h3>MIRANDA</h3>
<blockquote><div>Yes, for a score of kingdoms you should wrangle,<br />
And I would call it, fair play.
</div></blockquote>

<h3>ALONSO</h3>
<blockquote><div>If this prove<br />
A vision of the Island, one dear son<br />
Shall I twice lose.
</div></blockquote>

<h3>SEBASTIAN</h3>
<blockquote><div>A most high miracle!
</div></blockquote>

<h3>FERDINAND</h3>
<blockquote><div>Though the seas threaten, they are merciful;<br />
I have cursed them without cause.<br />
<i>Kneels</i></div></blockquote>

<h3>ALONSO</h3>
<blockquote><div>Now all the blessings<br />
Of a glad father compass thee about!<br />
Arise, and say how thou camest here.
</div></blockquote>

<h3>MIRANDA</h3>
<blockquote><div>O, wonder!<br />
How many goodly creatures are there here!<br />
How beauteous mankind is! O brave new world,<br />
That has such people in't!
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>'Tis new to thee.
</div></blockquote>

<h3>ALONSO</h3>
<blockquote><div>What is this maid with whom thou wast at play?<br />
Your eld'st acquaintance cannot be three hours:<br />
Is she the goddess that hath sever'd us,<br />
And brought us thus together?
</div></blockquote>

<h3>FERDINAND</h3>
<blockquote><div>Sir, she is mortal;<br />
But by immortal Providence she's mine:<br />
I chose her when I could not ask my father<br />
For his advice, nor thought I had one. She<br />
Is daughter to this famous Duke of Milan,<br />
Of whom so often I have heard renown,<br />
But never saw before; of whom I have<br />
Received a second life; and second father<br />
This lady makes him to me.
</div></blockquote>

<h3>ALONSO</h3>
<blockquote><div>I am hers:<br />
But, O, how oddly will it sound that I<br />
Must ask my child forgiveness!
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>There, sir, stop:<br />
Let us not burthen our remembrance with<br />
A heaviness that's gone.
</div></blockquote>

<h3>GONZALO</h3>
<blockquote><div>I have inly wept,<br />
Or should have spoke ere this. Look down, you god,<br />
And on this couple drop a blessed crown!<br />
For it is you that have chalk'd forth the way<br />
Which brought us hither.
</div></blockquote>

<h3>ALONSO</h3>
<blockquote><div>I say, Amen, Gonzalo!
</div></blockquote>

<h3>GONZALO</h3>
<blockquote><div>Was Milan thrust from Milan, that his issue<br />
Should become kings of Naples? O, rejoice<br />
Beyond a common joy, and set it down<br />
With gold on lasting pillars: In one voyage<br />
Did Claribel her husband find at Tunis,<br />
And Ferdinand, her brother, found a wife<br />
Where he himself was lost, Prospero his dukedom<br />
In a poor isle and all of us ourselves<br />
When no man was his own.
</div></blockquote>

<h3>ALONSO</h3>
<blockquote><div>[To FERDINAND and MIRANDA] Give me your hands:<br />
Let grief and sorrow still embrace his heart<br />
That doth not wish you joy!
</div></blockquote>

<h3>GONZALO</h3>
<blockquote><div>Be it so! Amen!<br />

<i>Re-enter ARIEL, with the Master and BOATSWAIN amazedly following</i></div></blockquote>

<h3>GONZALO</h3>
<blockquote><div>O, look, sir, look, sir! here is more of us:<br />
I prophesied, if a gallows were on land,<br />
This fellow could not drown. Now, blasphemy,<br />
That swear'st grace o'erboard, not an oath on shore?<br />
Hast thou no mouth by land? What is the news?
</div></blockquote>

<h3>BOATSWAIN</h3>
<blockquote><div>The best news is, that we have safely found<br />
Our king and company; the next, our ship--<br />
Which, but three glasses since, we gave out split--<br />
Is tight and yare and bravely rigg'd as when<br />
We first put out to sea.
</div></blockquote>

<h3>ARIEL</h3>
<blockquote><div>[Aside to PROSPERO] Sir, all this service<br />
Have I done since I went.
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>[Aside to ARIEL] My tricksy spirit!
</div></blockquote>

<h3>ALONSO</h3>
<blockquote><div>These are not natural events; they strengthen<br />
From strange to stranger. Say, how came you hither?
</div></blockquote>

<h3>BOATSWAIN</h3>
<blockquote><div>If I did think, sir, I were well awake,<br />
I'ld strive to tell you. We were dead of sleep,<br />
And--how we know not--all clapp'd under hatches;<br />
Where but even now with strange and several noises<br />
Of roaring, shrieking, howling, jingling chains,<br />
And more diversity of sounds, all horrible,<br />
We were awaked; straightway, at liberty;<br />
Where we, in all her trim, freshly beheld<br />
Our royal, good and gallant ship, our master<br />
Capering to eye her: on a trice, so please you,<br />
Even in a dream, were we divided from them<br />
And were brought moping hither.
</div></blockquote>

<h3>ARIEL</h3>
<blockquote><div>[Aside to PROSPERO] Was't well done?
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>[Aside to ARIEL] Bravely, my diligence. Thou shalt be free.
</div></blockquote>

<h3>ALONSO</h3>
<blockquote><div>This is as strange a maze as e'er men trod<br />
And there is in this business more than nature<br />
Was ever conduct of: some oracle<br />
Must rectify our knowledge.
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>Sir, my liege,<br />
Do not infest your mind with beating on<br />
The strangeness of this business; at pick'd leisure<br />
Which shall be shortly, single I'll resolve you,<br />
Which to you shall seem probable, of every<br />
These happen'd accidents; till when, be cheerful<br />
And think of each thing well.<br />

<blockquote><div><i>Aside to ARIEL</i></div></blockquote>Come hither, spirit:<br />
Set Caliban and his companions free;<br />
Untie the spell.<br />

<blockquote><div><i>Exit ARIEL</i></div></blockquote>How fares my gracious sir?<br />
There are yet missing of your company<br />
Some few odd lads that you remember not.<br /><br />
<i>Re-enter ARIEL, driving in CALIBAN, STEPHANO and TRINCULO, in their stolen apparel</i></div></blockquote>

<h3>STEPHANO</h3>
<blockquote><div>Every man shift for all the rest, and<br />
let no man take care for himself; for all is<br />
but fortune. Coragio, bully-monster, coragio!
</div></blockquote>

<h3>TRINCULO</h3>
<blockquote><div>If these be true spies which I wear in my head,<br />
here's a goodly sight.
</div></blockquote>

<h3>CALIBAN</h3>
<blockquote><div>O Setebos, these be brave spirits indeed!<br />
How fine my master is! I am afraid<br />
He will chastise me.
</div></blockquote>

<h3>SEBASTIAN</h3>
<blockquote><div>Ha, ha!<br />
What things are these, my lord Antonio?<br />
Will money buy 'em?
</div></blockquote>

<h3>ANTONIO</h3>
<blockquote><div>Very like; one of them<br />
Is a plain fish, and, no doubt, marketable.
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>Mark but the badges of these men, my lords,<br />
Then say if they be true. This mis-shapen knave,<br />
His mother was a witch, and one so strong<br />
That could control the moon, make flows and ebbs,<br />
And deal in her command without her power.<br />
These three have robb'd me; and this demi-devil--<br />
For he's a bastard one--had plotted with them<br />
To take my life. Two of these fellows you<br />
Must know and own; this thing of darkness!<br />
Acknowledge mine.
</div></blockquote>

<h3>CALIBAN</h3>
<blockquote><div>I shall be pinch'd to death.
</div></blockquote>

<h3>ALONSO</h3>
<blockquote><div>Is not this Stephano, my drunken butler?
</div></blockquote>

<h3>SEBASTIAN</h3>
<blockquote><div>He is drunk now: where had he wine?
</div></blockquote>

<h3>ALONSO</h3>
<blockquote><div>And Trinculo is reeling ripe: where should they<br />
Find this grand liquor that hath gilded 'em?<br />
How camest thou in this pickle?
</div></blockquote>

<h3>TRINCULO</h3>
<blockquote><div>I have been in such a pickle since I<br />
saw you last that, I fear me, will never out of<br />
my bones: I shall not fear fly-blowing.
</div></blockquote>

<h3>SEBASTIAN</h3>
<blockquote><div>Why, how now, Stephano!
</div></blockquote>

<h3>STEPHANO</h3>
<blockquote><div>O, touch me not; I am not Stephano, but a cramp.
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>You'ld be king o' the isle, sirrah?
</div></blockquote>

<h3>STEPHANO</h3>
<blockquote><div>I should have been a sore one then.
</div></blockquote>

<h3>ALONSO</h3>
<blockquote><div>This is a strange thing as e'er I look'd on.<br /><br />
<i>Pointing to Caliban</i></div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>He is as disproportion'd in his manners<br />
As in his shape. Go, sirrah, to my cell;<br />
Take with you your companions; as you look<br />
To have my pardon, trim it handsomely.
</div></blockquote>

<h3>CALIBAN</h3>
<blockquote><div>Ay, that I will; and I'll be wise hereafter<br />
And seek for grace. What a thrice-double ass<br />
Was I, to take this drunkard for a god<br />
And worship this dull fool!
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>Go to; away!
</div></blockquote>

<h3>ALONSO</h3>
<blockquote><div>Hence, and bestow your luggage where you found it.
</div></blockquote>

<h3>SEBASTIAN</h3>
<blockquote><div>Or stole it, rather.
</div></blockquote>

<blockquote><div><i>Exeunt CALIBAN, STEPHANO, and TRINCULO</i></div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>Sir, I invite your highness and your train<br />
To my poor cell, where you shall take your rest<br />
For this one night; which, part of it, I'll waste<br />
With such discourse as, I not doubt, shall make it<br />
Go quick away; the story of my life<br />
And the particular accidents gone by<br />
Since I came to this isle: and in the morn<br />
I'll bring you to your ship and so to Naples,<br />
Where I have hope to see the nuptial<br />
Of these our dear-beloved solemnized;<br />
And thence retire me to my Milan, where<br />
Every third thought shall be my grave.
</div></blockquote>

<h3>ALONSO</h3>
<blockquote><div>I long<br />
To hear the story of your life, which must<br />
Take the ear strangely.
</div></blockquote>

<h3>PROSPERO</h3>
<blockquote><div>I'll deliver all;<br />
And promise you calm seas, auspicious gales<br />
And sail so expeditious that shall catch<br />
Your royal fleet far off.<br />

<blockquote><div><i>Aside to ARIEL</i></div></blockquote>My Ariel, chick,<br />
That is thy charge: then to the elements<br />
Be free, and fare thou well! Please you, draw near.<br />

<blockquote><div><i>Exeunt</i></div></blockquote>EPILOGUE<br />
SPOKEN BY PROSPERO<br />
Now my charms are all o'erthrown,<br />
And what strength I have's mine own,<br />
Which is most faint: now, 'tis true,<br />
I must be here confined by you,<br />
Or sent to Naples. Let me not,<br />
Since I have my dukedom got<br />
And pardon'd the deceiver, dwell<br />
In this bare island by your spell;<br />
But release me from my bands<br />
With the help of your good hands:<br />
Gentle breath of yours my sails<br />
Must fill, or else my project fails,<br />
Which was to please. Now I want<br />
Spirits to enforce, art to enchant,<br />
And my ending is despair,<br />
Unless I be relieved by prayer,<br />
Which pierces so that it assaults<br />
Mercy itself and frees all faults.<br />
As you from crimes would pardon'd be,<br />
Let your indulgence set me free.
</div></blockquote>
</div>

</body>
</html>
  

JavaScript:

 window.onload = createList;

function addEvent(object, evName, fnName, cap) {
   if (object.attachEvent)
       object.attachEvent("on"   evName, fnName);
   else if (object.addEventListener)
       object.addEventListener(evName, fnName, cap);
}


function uniqueElemText(elemName) {
   elems = document.getElementsByTagName(elemName);
   elemsArray = new Array();

   for (var i=0; i<elems.length; i  ) elemsArray[i]=elems[i].innerHTML;  
   elemsArray.sort();
   for (i=0; i<elemsArray.length-1; i  ) {
      if (elemsArray[i]==elemsArray[i 1]) {
         elemsArray.splice(i 1,1);
         i--;
      }
   }
   return elemsArray;
}

function createList(){
    var option;
    var characters = new Array();
    var select = document.createElement('select');
        select.setAttribute('id', 'charList');
        select.addEventListener('change', filter, false);
    var charBox = document.getElementById('characterList');
        charBox.innerHTML = '<p>Show Only Line By:</p>';
        charBox.appendChild(select);

    var tempChar = document.getElementsByTagName('h3');
    for(var i = 0; i < tempChar.length; i  )
        if(characters.indexOf(tempChar[i].innerHTML) == -1)
            characters.push(tempChar[i].innerHTML);
    delete tempChar;
    characters.sort();

    option = document.createElement("option");
    option.text = "Show All Character Lines";
    option.value = 'ALL';
    select.add(option);

    for(var i = 0; i < characters.length; i  )
    {
        option = document.createElement("option");
        option.text = characters[i];
        option.value = characters[i];
        select.add(option);
    }
}

function filter(){
    var scene = document.getElementById('scene');
    var elemList = scene.getElementsByTagName('*');
    var list = document.getElementById('charList');
    var character = list.options[list.selectedIndex].value;

    var hide = false;

    for (var i = 0; i < elemList.length; i  ) {
        var elem = elemList[i];
        if (elem.tagName == "H3") {
            hide = (elemList[i].innerHTML.indexOf(character) == -1)
        }

        if (hide) {
            elem.style.opacity = 0.0;
        } else {
            elem.style.opacity = 1.0;
        }
    }
}
  

Ответ №1:

Примечание: Мне пришлось удалить некоторые кавычки с заголовками из-за ограничения символов в ответе

Фрагмент ниже

 window.onload = createList;

function addEvent(object, evName, fnName, cap) {
  if (object.attachEvent)
    object.attachEvent("on"   evName, fnName);
  else if (object.addEventListener)
    object.addEventListener(evName, fnName, cap);
}


function uniqueElemText(elemName) {
  elems = document.getElementsByTagName(elemName);
  elemsArray = new Array();

  for (var i = 0; i < elems.length; i  ) elemsArray[i] = elems[i].innerHTML;
  elemsArray.sort();
  for (i = 0; i < elemsArray.length - 1; i  ) {
    if (elemsArray[i] == elemsArray[i   1]) {
      elemsArray.splice(i   1, 1);
      i--;
    }
  }
  return elemsArray;
}

function createList() {
  var option;
  var characters = new Array();
  var select = document.createElement('select');
  select.setAttribute('id', 'charList');
  select.addEventListener('change', filter, false);
  var charBox = document.getElementById('characterList');
  charBox.innerHTML = '<p>Show Only Line By:</p>';
  charBox.appendChild(select);

  var tempChar = document.getElementsByTagName('h3');
  for (var i = 0; i < tempChar.length; i  )
    if (characters.indexOf(tempChar[i].innerHTML) == -1)
      characters.push(tempChar[i].innerHTML);
  delete tempChar;
  characters.sort();

  option = document.createElement("option");
  option.text = "Show All Character Lines";
  option.value = 'ALL';
  select.add(option);

  for (var i = 0; i < characters.length; i  ) {
    option = document.createElement("option");
    option.text = characters[i];
    option.value = characters[i];
    select.add(option);
  }
}

function filter() {
  var scene = document.getElementById('scene');
  var elemList = scene.getElementsByTagName('h3');
  var list = document.getElementById('charList');
  var character = list.options[list.selectedIndex].value.trim();

  if (character == "ALL") {
    for (var i = 0; i < elemList.length; i  ) {
      console.log()
      var elem = elemList[i];
      elem.style.display = "block";
      elem.nextElementSibling.setAttribute('style', "display:block;");
    }
    return
  }

  var hide = false;

  for (var i = 0; i < elemList.length; i  ) {
    var elem = elemList[i];

    if (elem.tagName == "H3") {
      hide = (elemList[i].textContent.trim().indexOf(character) == -1)
    }

    if (hide == true) {
      elem.style.display = "none";
      elem.nextElementSibling.setAttribute('style', "display:none;");
      console.log(elem.nextElementSibling.style.display)
    } else {
      elem.style.display = "block";
      elem.nextElementSibling.setAttribute('style', "display:block;");
      console.log(elem.nextElementSibling.tagName)
    }
  }
}  
 blockquote,
h3 {
  display: none;
}  
 <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">

<head>

  <title>The Tempest, Act V, Scene 1</title>
  <meta charset="UTF-8" />
  <link href="plays.css" rel="stylesheet" type="text/css" />
  <script src="scene.js" type="text/javascript"></script>
</head>

<body>
  <div id="linklist">
    <img src="plays_out.jpg" alt="The Plays" />
    <img src="son_out.jpg" alt="The Sonnets" />
    <img src="bio_out.jpg" alt="Biography" />
    <img src="globe_out.jpg" alt="The Globe" />
    <img src="strat_out.jpg" alt="Stratford" />
  </div>
  <div id="title">
    <img src="tempest.jpg" alt="The Tempest" />
  </div>
  <div id="actList">
    <table>
      <tr>
        <td>ACT I</td>
        <td>ACT II</td>
        <td>ACT III</td>
        <td>ACT IV</td>
        <td>ACT V</td>
      </tr>
    </table>
  </div>

  <div id="characterList"></div>


  <div id="sceneIntro">
    <h2>Lines from Act V, Scene 1</h2>
  </div>

  <div id="scene">
    <h3>PROSPERO</h3>
    <blockquote>
      <div><i>Enter PROSPERO in his magic robes, and ARIEL</i>
      </div>
    </blockquote>
    <blockquote>
      <div>Now does my project gather to a head:
        <br />My charms crack not; my spirits obey; and time
        <br />Goes upright with his carriage. How's the day?
      </div>
    </blockquote>

    <h3>ARIEL</h3>
    <blockquote>
      <div>On the sixth hour; at which time, my lord,
        <br />You said our work should cease.
      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote>
      <div>I did say so,
        <br />When first I raised the tempest. Say, my spirit,
        <br/>How fares the king and's followers?
      </div>
    </blockquote>

    <h3>ARIEL</h3>
    <blockquote>
      <div>Confined together
        <br />In the same fashion as you gave in charge,
        <br />Just as you left them; all prisoners, sir,
        <br />In the line-grove which weather-fends your cell;
        <br />They cannot budge till your release. The king,
        <br />His brother and yours, abide all three distracted

      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote>

      <div>Dost thou think so, spirit?
      </div>
    </blockquote>

    <h3>ARIEL</h3>
    <blockquote>
      <div>Mine would, sir, were I human.
      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote>
      <div>And mine shall.
        <br />Hast thou, which art but air, a touch, a feeling
        <br />Of their afflictions, and shall not myself,
        <br />One of their kind, that relish all as sharply,
        <br />Passion as they, be kindlier moved than thou art?
        <br />Though with their high wrongs I am struck to the quick,
        <br />Yet with my nobler reason 'gaitist my fury
        <br />Do I take part: the rarer action is
        <br />In virtue than in vengeance: they being penitent,
        <br />The sole drift of my purpose doth extend
        <br />Not a frown further. Go release them, Ariel:
        <br />My charms I'll break, their senses I'll restore,
        <br />And they shall be themselves.
      </div>
    </blockquote>

    <h3>ARIEL</h3>
    <blockquote>
      <div>I'll fetch them, sir.</div>
    </blockquote>

    <blockquote>
      <div><i>Exit</i>
      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote style="">
      <div>Ye elves of hills, brooks, standing lakes and groves,
        <br />And ye that on the sands with printless foot
        <br />Do chase the ebbing Neptune and do fly him
        <br />When he comes back; you demi-puppets that
        <br />By moonshine do the green sour ringlets make,
        <br />Whereof the ewe not bites, and you whose pastime
        <br />Is to make midnight mushrooms, that rejoice
        <br />To hear the solemn curfew; by whose aid,
        <br />Weak masters though ye be, I have bedimm'd
        <br />The noontide sun, call'd forth the mutinous winds,
        <br />And 'twixt the green sea and the azured vault
        <br />Set roaring war: to the dread rattling thunder
        <br />Have I given fire and rifted Jove's stout oak
        <br />With his own bo< the strong-based promontory
        <br />Have I made shake and by the spurs pluck'd up
        <br />The pine and cedar: graves at my command
        <br />Have waked their sleepers, oped, and let 'em forth
        <br />By my so potent art. But this rough magic
        <br />I here abjure, and, when I have required
        <br />Some heavenly music, which even now I do,
        <br />To work mine end upon their senses that
        <br />This airy charm is for, I'll break my staff,
        <br />Bury it certain fathoms in the earth,
        <br />And deeper than did ever plummet sound
        <br />I'll drown my book.
      </div>
    </blockquote>

    <blockquote>
      <div><i>Solemn music</i>
      </div>
    </blockquote>

    <blockquote>
      <div><i>Re-enter ARIEL before: then ALONSO, with a frantic gesture, attended by GONZALO; SEBASTIAN and ANTONIO in like manner, attended by ADRIAN and FRANCISCO they all enter the circle which PROSPERO had made, and there stand charmed; which PROSPERO observes.</i>
      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote>
      <div>A solemn air and the best comforter
        <br />To an unsettled fancy cure thy brains,
        <br />Now useless, boil'd within thy skull! There stand,
        <br />For you are spell-stopp'd.
        <br />Holy Gonzalo, honourable man,
        <br />Mine eyes, even sociable to the show of thine,
        <br />Fall fellowly drops. The charm dissolves apace,
        <br />And as the morning steals upon the night,
        <br />Melting the darkness, so their rising senses
        <br />Begin to chase the ignorant fumes that mantle
        <br />Their clearer reason. O good Gonzalo,
        <br />My true preserver, and a loyal sir
        <br />To him you follow'st! I will pay thy graces
        <br />Home both in word and deed. Most cruelly
        <br />Didst thou, Alonso, use me and my daughter:
        <br />Thy brother was a furtherer in the act.
        <br />Thou art pinch'd fort now, Sebastian. Flesh and blood,
        <br />You, brother mine, that entertain'd ambition,
        <br />Expell'd remorse and nature; who, with Sebastian,
        <br />Whose inward pinches therefore are most strong,
        <br />Would here have kill'd your king; I do forgive thee,
        <br />Unnatural though thou art. Their understanding
        <br />Begins to swell, and the approaching tide
        <br />Will shortly fill the reasonable shore
        <br />That now lies foul and muddy. Not one of them
        <br />That yet looks on me, or would know me Ariel,
        <br />Fetch me the hat and rapier in my cell:
        <br />I will discase me, and myself present
        <br />As I was sometime Milan: quickly, spirit;
        <br />Thou shalt ere long be free.
      </div>
    </blockquote>

    <blockquote>
      <div><i>ARIEL sings and helps to attire him</i>
      </div>
    </blockquote>

    <h3>ARIEL</h3>
    <blockquote>
      <div>Where the bee sucks. there suck I:
        <br />In a cowslip's bell I lie;
        <br />There I couch when owls do cry.
        <br />On the bat's back I do fly
        <br />After summer merrily.
        <br />Merrily, merrily shall I live now
        <br />Under the blossom that hangs on the bough.
      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote>
      <div>Why, that's my dainty Ariel! I shall miss thee:
        <br />But yet thou shalt have freedom: so, so, so.
        <br />To the king's ship, invisible as thou art:
        <br />There shalt thou find the mariners asleep
        <br />Under the hatches; the master and the BOATSWAIN
        <br />Being awake, enforce them to this place,
        <br />And presently, I prithee.
      </div>
    </blockquote>

    <h3>ARIEL</h3>
    <blockquote>
      <div>I drink the air before me, and return
        <br />Or ere your pulse twice beat.
      </div>
    </blockquote>

    <blockquote>
      <div><i>Exit</i>
      </div>
    </blockquote>

    <h3>GONZALO</h3>
    <blockquote>
      <div>All torment, trouble, wonder and amazement
        <br />Inhabits here: some heavenly power guide us
        <br />Out of this fearful country!
      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote>
      <div>Behold, sir king,
        <br />The wronged Duke of Milan, Prospero:
        <br />For more assurance that a living prince
        <br />Does now speak to thee, I embrace thy body;
        <br />And to thee and thy company I bid
        <br />A hearty welcome.
      </div>
    </blockquote>

    <h3>ALONSO</h3>
    <blockquote>
      <div>Whether thou best he or no,
        <br />Or some enchanted trifle to abuse me,
        <br />As late I have been, I not know: thy pulse
        <br />Beats as of flesh and blood; and, since I saw thee,
        <br />The affliction of my mind amends, with which,
        <br />I fear, a madness held me: this must crave,
        <br />An if this be at all, a most strange story.
        <br />Thy dukedom I resign and do entreat
        <br />Thou pardon me my wrongs. But how should Prospero
        <br />Be living and be here?
      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote>
      <div>First, noble friend,
        <br />Let me embrace thine age, whose honour cannot
        <br />Be measured or confined.
      </div>
    </blockquote>

    <h3>GONZALO</h3>
    <blockquote>
      <div>Whether this be
        <br />Or be not, I'll not swear.
      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote>
      <div>You do yet taste
        <br />Some subtilties o' the isle, that will not let you
        <br />Believe things certain. Welcome, my friends all!
        <br />But you, my brace of lords, were I so minded,
        <br />I here could pluck his highness' frown upon you
        <br />And justify you traitors: at this time
        <br />I will tell no tales.
      </div>
    </blockquote>

    <h3>SEBASTIAN</h3>
    <blockquote>
      <div>[Aside] The devil speaks in him.
      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote>
      <div>No.
        <br />For you, most wicked sir, whom to call brother
        <br />Would even infect my mouth, I do forgive
        <br />Thy rankest fau< all of them; and require
        <br />My dukedom of thee, which perforce, I know,
        <br />Thou must restore.
      </div>
    </blockquote>

    <h3>ALONSO</h3>
    <blockquote>
      <div>If thou be'st Prospero,
        <br />Give us particulars of thy preservation;
        <br />How thou hast met us here, who three hours since
        <br />Were wreck'd upon this shore; where I have lost--
        <br />How sharp the point of this remembrance is!--
        <br />My dear son Ferdinand.
      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote>
      <div>I am woe for't, sir.
      </div>
    </blockquote>

    <h3>ALONSO</h3>
    <blockquote>
      <div>Irreparable is the loss, and patience
        <br />Says it is past her cure.
      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote>
      <div>I rather think
        <br />You have not sought her help, of whose soft grace
        <br />For the like loss I have her sovereign aid
        <br />And rest myself content.
      </div>
    </blockquote>

    <h3>ALONSO</h3>
    <blockquote>
      <div>You the like loss!
      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote>
      <div>As great to me as late; and, supportable
        <br />To make the dear loss, have I means much weaker
        <br />Than you may call to comfort you, for I
        <br />Have lost my daughter.
      </div>
    </blockquote>

    <h3>ALONSO</h3>
    <blockquote>
      <div>A daughter?
        <br />O heavens, that they were living both in Naples,
        <br />The king and queen there! that they were, I wish
        <br />Myself were mudded in that oozy bed
        <br />Where my son lies. When did you lose your daughter?
      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote>
      <div>In this last tempest. I perceive these lords
        <br />At this encounter do so much admire
        <br />That they devour their reason and scarce think
        <br />Their eyes do offices of truth, their words
        <br />Are natural breath: but, howsoe'er you have
        <br />Been justled from your senses, know for certain
        <br />That I am Prospero and that very duke
        <br />Which was thrust forth of Milan, who most strangely
        <br />Upon this shore, where you were wreck'd, was landed,
        <br />To be the lord on't. No more yet of this;
        <br />For 'tis a chronicle of day by day,
        <br />Not a relation for a breakfast nor
        <br />Befitting this first meeting. Welcome, sir;
        <br />This cell's my court: here have I few attendants
        <br />And subjects none abroad: pray you, look in.
        <br />My dukedom since you have given me again,
        <br />I will requite you with as good a thing;
        <br />At least bring forth a wonder, to content ye
        <br />As much as me my dukedom.
        <br />
        <br />
        <i>Here PROSPERO discovers FERDINAND and MIRANDA playing at chess</i>
      </div>
    </blockquote>

    <h3>MIRANDA</h3>
    <blockquote>
      <div>Sweet lord, you play me false.
      </div>
    </blockquote>

    <h3>FERDINAND</h3>
    <blockquote>
      <div>No, my dear'st love,
        <br />I would not for the world.
      </div>
    </blockquote>

    <h3>MIRANDA</h3>
    <blockquote>
      <div>Yes, for a score of kingdoms you should wrangle,
        <br />And I would call it, fair play.
      </div>
    </blockquote>

    <h3>ALONSO</h3>
    <blockquote>
      <div>If this prove
        <br />A vision of the Island, one dear son
        <br />Shall I twice lose.
      </div>
    </blockquote>

    <h3>SEBASTIAN</h3>
    <blockquote>
      <div>A most high miracle!
      </div>
    </blockquote>

    <h3>FERDINAND</h3>
    <blockquote>
      <div>Though the seas threaten, they are merciful;
        <br />I have cursed them without cause.
        <br />
        <i>Kneels</i>
      </div>
    </blockquote>

    <h3>ALONSO</h3>
    <blockquote>
      <div>Now all the blessings
        <br />Of a glad father compass thee about!
        <br />Arise, and say how thou camest here.
      </div>
    </blockquote>

    <h3>MIRANDA</h3>
    <blockquote>
      <div>O, wonder!
        <br />How many goodly creatures are there here!
        <br />How beauteous mankind is! O brave new world,
        <br />That has such people in't!
      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote>
      <div>'Tis new to thee.
      </div>
    </blockquote>

    <h3>ALONSO</h3>
    <blockquote>
      <div>What is this maid with whom thou wast at play?
        <br />Your eld'st acquaintance cannot be three hours:
        <br />Is she the goddess that hath sever'd us,
        <br />And brought us thus together?
      </div>
    </blockquote>

    <h3>FERDINAND</h3>
    <blockquote>
      <div>Sir, she is mortal;
        <br />But by immortal Providence she's mine:
        <br />I chose her when I could not ask my father
        <br />For his advice, nor thought I had one. She
        <br />Is daughter to this famous Duke of Milan,
        <br />Of whom so often I have heard renown,
        <br />But never saw before; of whom I have
        <br />Received a second life; and second father
        <br />This lady makes him to me.
      </div>
    </blockquote>

    <h3>ALONSO</h3>
    <blockquote>
      <div>I am hers:
        <br />But, O, how oddly will it sound that I
        <br />Must ask my child forgiveness!
      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote>
      <div>There, sir, stop:
        <br />Let us not burthen our remembrance with
        <br />A heaviness that's gone.
      </div>
    </blockquote>

    <h3>GONZALO</h3>
    <blockquote>
      <div>I have inly wept,
        <br />Or should have spoke ere this. Look down, you god,
        <br />And on this couple drop a blessed crown!
        <br />For it is you that have chalk'd forth the way
        <br />Which brought us hither.
      </div>
    </blockquote>

    <h3>ALONSO</h3>
    <blockquote>
      <div>I say, Amen, Gonzalo!
      </div>
    </blockquote>

    <h3>GONZALO</h3>
    <blockquote>
      <div>Was Milan thrust from Milan, that his issue
        <br />Should become kings of Naples? O, rejoice
        <br />Beyond a common joy, and set it down
        <br />With gold on lasting pillars: In one voyage
        <br />Did Claribel her husband find at Tunis,
        <br />And Ferdinand, her brother, found a wife
        <br />Where he himself was lost, Prospero his dukedom
        <br />In a poor isle and all of us ourselves
        <br />When no man was his own.
      </div>
    </blockquote>

    <h3>ALONSO</h3>
    <blockquote>
      <div>[To FERDINAND and MIRANDA] Give me your hands:
        <br />Let grief and sorrow still embrace his heart
        <br />That doth not wish you joy!
      </div>
    </blockquote>

    <h3>GONZALO</h3>
    <blockquote>
      <div>Be it so! Amen!
        <br />

        <i>Re-enter ARIEL, with the Master and BOATSWAIN amazedly following</i>
      </div>
    </blockquote>

    <h3>GONZALO</h3>
    <blockquote>
      <div>O, look, sir, look, sir! here is more of us:
        <br />I prophesied, if a gallows were on land,
        <br />This fellow could not drown. Now, blasphemy,
        <br />That swear'st grace o'erboard, not an oath on shore?
        <br />Hast thou no mouth by land? What is the news?
      </div>
    </blockquote>

    <h3>BOATSWAIN</h3>
    <blockquote>
      <div>The best news is, that we have safely found
        <br />Our king and company; the next, our ship--
        <br />Which, but three glasses since, we gave out split--
        <br />Is tight and yare and bravely rigg'd as when
        <br />We first put out to sea.
      </div>
    </blockquote>

    <h3>ARIEL</h3>
    <blockquote>
      <div>[Aside to PROSPERO] Sir, all this service
        <br />Have I done since I went.
      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote>
      <div>[Aside to ARIEL] My tricksy spirit!
      </div>
    </blockquote>

    <h3>ALONSO</h3>
    <blockquote>
      <div>These are not natural events; they strengthen
        <br />From strange to stranger. Say, how came you hither?
      </div>
    </blockquote>

    <h3>BOATSWAIN</h3>
    <blockquote>
      <div>If I did think, sir, I were well awake,
        <br />I'ld strive to tell you. We were dead of sleep,
        <br />And--how we know not--all clapp'd under hatches;
        <br />Where but even now with strange and several noises
        <br />Of roaring, shrieking, howling, jingling chains,
        <br />And more diversity of sounds, all horrible,
        <br />We were awaked; straightway, at liberty;
        <br />Where we, in all her trim, freshly beheld
        <br />Our royal, good and gallant ship, our master
        <br />Capering to eye her: on a trice, so please you,
        <br />Even in a dream, were we divided from them
        <br />And were brought moping hither.
      </div>
    </blockquote>

    <h3>ARIEL</h3>
    <blockquote>
      <div>[Aside to PROSPERO] Was't well done?
      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote>
      <div>[Aside to ARIEL] Bravely, my diligence. Thou shalt be free.
      </div>
    </blockquote>

    <h3>ALONSO</h3>
    <blockquote>
      <div>This is as strange a maze as e'er men trod
        <br />And there is in this business more than nature
        <br />Was ever conduct of: some oracle
        <br />Must rectify our knowledge.
      </div>
    </blockquote>

    <h3>PROSPERO</h3>
    <blockquote>
      <div>Sir, my liege,
        <br />Do not infest your mind with beating on
        <br />The strangeness of this business; at pick'd leisure
        <br />Which shall be shortly, single I'll resolve you,
        <br />Which to you shall seem probable, of every
        <br />These happen'd accidents; till when, be cheerful
        <br />And think of each thing well.
        <br />

        <blockquote>
          <div><i>Aside to ARIEL</i>
          </div>
        </blockquote>Come hither, spirit:
        <br />Set Caliban and his companions free;
        <br />Untie the spell.
        <br />

        <blockquote>
          <div><i>Exit ARIEL</i>
          </div>
        </blockquote>How fares my gracious sir?
        <br />There are yet missing of your company
        <br />Some few odd lads that you remember not.
        <br />
        <br />
        <i>Re-enter ARIEL, driving in CALIBAN, STEPHANO and TRINCULO, in their stolen apparel</i>
      </div>
    </blockquote>

    <h3>STEPHANO</h3>
    <blockquote>
      <div>Every man shift for all the rest, and
        <br />let no man take care for himself; for all is
        <br />but fortune. Coragio, bully-monster, coragio!
      </div>
    </blockquote>

    <h3>TRINCULO</h3>
    <blockquote>
      <div>If these be true spies which I wear in my head,
        <br />here's a goodly sight.
      </div>
    </blockquote>

    <h3>CALIBAN</h3>
    <blockquote>
      <div>O Setebos, these be brave spirits indeed!
        <br />How fine my master is! I am afraid
        <br />He will chastise me.
      </div>
    </blockquote>

    <h3>SEBASTIAN</h3>
    <blockquote>
      <div>Ha, ha!
        <br />What things are these, my lord Antonio?
        <br />Will money buy 'em?
      </div>
    </blockquote>  

Комментарии:

1. Я на самом деле внес некоторые изменения в ваш существующий codes.in условия оформления .. также обратите внимание, что я применил раздел css для оформления кавычек блоков и тегов заголовков в :display:none» при загрузке окна.

2. Я уже выяснил, как правильно отображать диалог персонажа. Моя главная проблема сейчас заключается в следующем… Когда вы фильтруете диалог по определенному символу, а затем пытаетесь выполнить фильтрацию обратно до «Показать все строки символов», вместо отображения всех строк символов отображается пустое значение. Я попробовал ваш код, и у него возникла та же проблема.

Ответ №2:

Я понял, что могу просто заменить elem.style.opacity = 0.0; на elem.style.display = 'none'; .

Я все еще оставляю вопрос открытым на случай, если кто-нибудь сможет помочь мне разобраться, как сбросить список и показать все строки диалога при выборе опции по умолчанию «Показывать все строки символов».